We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b38d7cd commit a8bc129Copy full SHA for a8bc129
timezone_field/fields.py
@@ -14,7 +14,6 @@ class TimeZoneField(models.CharField):
14
def __init__(self, *args, **kwargs):
15
defaults = {
16
"max_length": 63,
17
- "default": settings.TIME_ZONE,
18
"choices": TimeZoneField.CHOICES,
19
}
20
defaults.update(kwargs)
@@ -31,7 +30,7 @@ def run_validators(self, value):
31
30
def to_python(self, value):
32
value = super(TimeZoneField, self).to_python(value)
33
# if db is corrupted, will throw a pytz.UnknownTimeZoneError
34
- return pytz.timezone(value)
+ return pytz.timezone(value) if value else None
35
36
def get_prep_value(self, value):
37
if value is not None:
0 commit comments