Skip to content

Commit

Permalink
Merge 2a006dc into 15be798
Browse files Browse the repository at this point in the history
  • Loading branch information
mattxbart committed Feb 18, 2015
2 parents 15be798 + 2a006dc commit b7a3aa1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rest_framework_gis/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def to_representation(self, instance):
field_name = field.field_name
if field.read_only and instance is None:
continue
value = field.to_representation(field.get_attribute(instance))
value = field.get_attribute(instance)
if value:
value = field.to_representation(value)
if self.Meta.id_field is not False and field_name == self.Meta.id_field:
ret["id"] = value
elif field_name == self.Meta.geo_field:
Expand Down

0 comments on commit b7a3aa1

Please sign in to comment.