Permalink
Browse files

Allow setting to None.

  • Loading branch information...
1 parent 0ccee7e commit 33398b1750b2f39a3a2aefbe830ba7f47d3d8491 @dgoldenichec committed Jul 19, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 timezones/fields.py
View
3 timezones/fields.py
@@ -122,6 +122,9 @@ def get_dtz_field(instance):
return getattr(instance, dt_field_name)
def set_dtz_field(instance, dt):
+ if dt is None: # Allow None here (db will catch later for null=False)
+ setattr(instance, dt_field_name, None)
+ return
if dt.tzinfo is None:
dt = default_tz.localize(dt)
time_zone = field.timezone

0 comments on commit 33398b1

Please sign in to comment.