Skip to content
Browse files

Fixed typo and slightly improved error message when db is missing tim…

…e zone definitions.

Refs #21432.
  • Loading branch information...
1 parent 8e6d1b9 commit 32e75803be8b3e9c35e6735c265125c4130ffabc @loic loic committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/models/sql/
4 django/db/models/sql/
@@ -1083,8 +1083,8 @@ def results_iter(self):
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

0 comments on commit 32e7580

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