Work around a bug in django 1.4 and 1.5 for qsstats that would not allow

it to work with USE_TZ = True
This commit is contained in:
Matthew Jones
2014-07-08 10:24:29 -04:00
parent 1a7f3d17d6
commit 1590ce1762
2 changed files with 6 additions and 7 deletions

View File

@@ -122,6 +122,12 @@ class QuerySetStats(object):
stat_list = []
dt = start
try:
from django.utils.timezone import utc
dt = dt.replace(tzinfo=utc)
end = end.replace(tzinfo=utc)
except ImportError:
pass
while dt < end:
idx = 0
value = 0