Commit 32e75803 authored by Loic Bistuer's avatar Loic Bistuer
Browse files

Fixed typo and slightly improved error message when db is missing time zone definitions.

Refs #21432.
parent 8e6d1b97
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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