mirror of https://github.com/django/django.git
Fixed typo and slightly improved error message when db is missing time zone definitions.
Refs #21432.
This commit is contained in:
parent
8e6d1b9792
commit
32e75803be
|
@ -1083,8 +1083,8 @@ class SQLDateTimeCompiler(SQLCompiler):
|
|||
if settings.USE_TZ:
|
||||
if datetime is None:
|
||||
raise ValueError("Database returned an invalid value "
|
||||
"in QuerySet.dates(). Are time zone "
|
||||
"definitions and pytz installed?")
|
||||
"in QuerySet.datetimes(). Are time zone "
|
||||
"definitions for your database and pytz installed?")
|
||||
datetime = datetime.replace(tzinfo=None)
|
||||
datetime = timezone.make_aware(datetime, self.query.tzinfo)
|
||||
yield datetime
|
||||
|
|
Loading…
Reference in New Issue