mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
DateTimeField to_representation string check str -> six.string_types
This commit is contained in:
parent
ead620521e
commit
e61a4f19cf
|
@ -1072,7 +1072,7 @@ class DateTimeField(Field):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
if output_format.lower() == ISO_8601:
|
if output_format.lower() == ISO_8601:
|
||||||
if isinstance(value, str):
|
if isinstance(value, six.string_types):
|
||||||
format_strings = (format_prefix + timezone_extension
|
format_strings = (format_prefix + timezone_extension
|
||||||
for format_prefix in ('%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S', '%Y-%m-%dT%H:%M:%S.%f')
|
for format_prefix in ('%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S', '%Y-%m-%dT%H:%M:%S.%f')
|
||||||
for timezone_extension in ('', '%Z', '%z'))
|
for timezone_extension in ('', '%Z', '%z'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user