mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Merge e77320fa5b
into 0b864acd98
This commit is contained in:
commit
806ed07d8f
|
@ -1006,7 +1006,8 @@ class ImageField(FileField):
|
|||
if hasattr(data, 'temporary_file_path'):
|
||||
file = data.temporary_file_path()
|
||||
else:
|
||||
if hasattr(data, 'read'):
|
||||
if hasattr(data, 'read') and hasattr(data, 'seek'):
|
||||
data.seek(0)
|
||||
file = BytesIO(data.read())
|
||||
else:
|
||||
file = BytesIO(data['content'])
|
||||
|
|
Loading…
Reference in New Issue
Block a user