This commit is contained in:
Aron Podrigal 2015-06-24 13:15:47 +00:00
commit 912bb78cfc

View File

@ -1198,7 +1198,7 @@ class FileField(Field):
return data return data
def to_representation(self, value): def to_representation(self, value):
if self.use_url: if self.use_url and hasattr(value, 'url'):
if not value: if not value:
return None return None
url = value.url url = value.url