From e61a4f19cf5f89c2506a5f6a3e61b0d2d864efc2 Mon Sep 17 00:00:00 2001 From: cabbagenom Date: Sun, 27 Mar 2016 12:08:52 +0100 Subject: [PATCH] DateTimeField to_representation string check str -> six.string_types --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 16074b76a..d4496a2e8 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1072,7 +1072,7 @@ class DateTimeField(Field): return value if output_format.lower() == ISO_8601: - if isinstance(value, str): + if isinstance(value, six.string_types): 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 timezone_extension in ('', '%Z', '%z'))