Browse files

Merge branch 'master' into develop

  • Loading branch information...
2 parents dc96afa + 73bd382 commit b6cf14090889b2f0edb0d9172a46cfe8277f196c @mpdaugherty committed May 28, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −2 timezone_field/fields.py
  2. +1 −0 timezone_field/tests.py
View
4 timezone_field/fields.py
@@ -62,7 +62,7 @@ def to_python(self, value):
# inspriation from django's Datetime field
if value is None or value == '':
return None
- if isinstance(value, pytz.tzinfo.BaseTzInfo):
+ if isinstance(value, pytz.tzinfo.BaseTzInfo) or isinstance(value, type(pytz.utc)):
return value
if isinstance(value, basestring):
try:
@@ -77,7 +77,7 @@ def get_prep_value(self, value):
value = self.to_python(value)
if value is None:
return ''
- if isinstance(value, pytz.tzinfo.BaseTzInfo):
+ if isinstance(value, pytz.tzinfo.BaseTzInfo) or isinstance(value, type(pytz.utc)):
return smart_unicode(value)
def value_to_string(self, value):
View
1 timezone_field/tests.py
@@ -10,6 +10,7 @@
PST = 'America/Los_Angeles'
EST = 'America/New_York'
+UTC = 'UTC'
INVALID_TZ = 'ogga booga'

0 comments on commit b6cf140

Please sign in to comment.