mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 05:20:12 +03:00
fix isoformat error
This commit is contained in:
parent
4f1506c77e
commit
4bc3c2354a
|
@ -910,7 +910,7 @@ class DateField(Field):
|
|||
self.fail('invalid', format=humanized_format)
|
||||
|
||||
def to_representation(self, value):
|
||||
if self.format is None:
|
||||
if self.format or value is None:
|
||||
return value
|
||||
|
||||
# Applying a `DateField` to a datetime value is almost always
|
||||
|
|
Loading…
Reference in New Issue
Block a user