Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Added a missing warning forgotten in r17392.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 8f16897 commit 0907233040fa0fe48185f2eb650dd677bdeb7878 @jezdez jezdez committed
Showing with 7 additions and 0 deletions.
  1. +7 −0 django/db/models/fields/
7 django/db/models/fields/
@@ -750,6 +750,13 @@ def to_python(self, value):
if isinstance(value,
value = datetime.datetime(value.year, value.month,
if settings.USE_TZ:
+ # For backwards compatibility, interpret naive datetimes in
+ # local time. This won't work during DST change, but we can't
+ # do much about it, so we let the exceptions percolate up the
+ # call stack.
+ warnings.warn(u"DateTimeField received a naive datetime (%s)"
+ u" while time zone support is active." % value,
+ RuntimeWarning)
default_timezone = timezone.get_default_timezone()
value = timezone.make_aware(value, default_timezone)
return value

0 comments on commit 0907233

Please sign in to comment.
Something went wrong with that request. Please try again.