fix isoformat error

This commit is contained in:
Matt Bartolome 2015-02-18 08:38:08 -08:00
parent 4f1506c77e
commit 4bc3c2354a

View File

@ -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