iso8601.is8601.Utc No Longer Exists

iso8601.UTC is correct datetime UTC field object.

iso8601.UTC is correct datetime UTC field object.
iso8601 >= 0.1.12 includes only iso8601.UTC for python3
while both UTC and Utc() for python2. Less then 0.1.12
included both UTC and Utc() for both python2/3.

Change-Id: Ie7957959e836d2f78409d4197c6a2d7ad9e8457b
Closes-Bug: #1713354
This commit is contained in:
Sean McCully 2017-08-27 15:07:40 -04:00
parent 6646120108
commit 934fb45a2d

View File

@ -468,7 +468,7 @@ class DateTime(FieldType):
# NOTE(danms): Legacy objects from sqlalchemy are stored in UTC,
# but are returned without a timezone attached.
# As a transitional aid, assume a tz-naive object is in UTC.
value = value.replace(tzinfo=iso8601.iso8601.Utc())
value = value.replace(tzinfo=iso8601.UTC)
elif not self.tzinfo_aware:
value = value.replace(tzinfo=None)
return value