mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
changed datefield to match code layout of datetime and time changes
This commit is contained in:
parent
f3d5e1482b
commit
d9c360845d
|
@ -1121,11 +1121,11 @@ class DateField(Field):
|
|||
self.fail('invalid', format=humanized_format)
|
||||
|
||||
def to_representation(self, value):
|
||||
output_format = getattr(self, 'format', api_settings.DATE_FORMAT)
|
||||
|
||||
if not value:
|
||||
return None
|
||||
|
||||
output_format = getattr(self, 'format', api_settings.DATE_FORMAT)
|
||||
|
||||
if output_format is None:
|
||||
return value
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user