Skip to content

Commit 02fca38

Browse files
Added is_naive check back to the LinkedTZDateTimeField.to_python() method.
1 parent 6fb53cc commit 02fca38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

timezone_utils/fields.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ def to_python(self, value):
242242
if not value:
243243
return value
244244

245+
if is_naive(value):
246+
return make_aware(value=value, timezone=self.timezone)
247+
245248
return value.astimezone(self.timezone)
246249

247250
def pre_save(self, model_instance, add):

0 commit comments

Comments
 (0)