1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Merge pull request #1921 from loic/ticket21432

Fixed typo and slightly improved error message when db is missing time zone definitions.
This commit is contained in:
Alex Gaynor 2013-11-15 05:05:20 -08:00
commit a90ffcac21

View File

@ -1083,8 +1083,8 @@ class SQLDateTimeCompiler(SQLCompiler):
if settings.USE_TZ: if settings.USE_TZ:
if datetime is None: if datetime is None:
raise ValueError("Database returned an invalid value " raise ValueError("Database returned an invalid value "
"in QuerySet.dates(). Are time zone " "in QuerySet.datetimes(). Are time zone "
"definitions and pytz installed?") "definitions for your database and pytz installed?")
datetime = datetime.replace(tzinfo=None) datetime = datetime.replace(tzinfo=None)
datetime = timezone.make_aware(datetime, self.query.tzinfo) datetime = timezone.make_aware(datetime, self.query.tzinfo)
yield datetime yield datetime