mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Update fields.py
This commit is contained in:
parent
81d84fc897
commit
4b4f1bfd4a
|
@ -994,7 +994,7 @@ class ImageField(FileField):
|
|||
super(ImageField, self).__init__(*args, **kwargs)
|
||||
|
||||
def to_native(self, value):
|
||||
if self.show_url:
|
||||
if value and self.show_url:
|
||||
return value.url
|
||||
return value.name
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user