From 32e75803be8b3e9c35e6735c265125c4130ffabc Mon Sep 17 00:00:00 2001 From: Loic Bistuer Date: Fri, 15 Nov 2013 10:55:29 +0700 Subject: [PATCH] Fixed typo and slightly improved error message when db is missing time zone definitions. Refs #21432. --- django/db/models/sql/compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 38806e7dc20..98b953937f2 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -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