mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-25 00:34:21 +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)
|
self.fail('invalid', format=humanized_format)
|
||||||
|
|
||||||
def to_representation(self, value):
|
def to_representation(self, value):
|
||||||
output_format = getattr(self, 'format', api_settings.DATE_FORMAT)
|
|
||||||
|
|
||||||
if not value:
|
if not value:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
output_format = getattr(self, 'format', api_settings.DATE_FORMAT)
|
||||||
|
|
||||||
if output_format is None:
|
if output_format is None:
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user