mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
Merge 010db598f6
into 9b8f966e06
This commit is contained in:
commit
912bb78cfc
|
@ -1198,7 +1198,7 @@ class FileField(Field):
|
|||
return data
|
||||
|
||||
def to_representation(self, value):
|
||||
if self.use_url:
|
||||
if self.use_url and hasattr(value, 'url'):
|
||||
if not value:
|
||||
return None
|
||||
url = value.url
|
||||
|
|
Loading…
Reference in New Issue
Block a user