diff options
author | Dan McGee <dan@archlinux.org> | 2012-09-30 10:11:19 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-09-30 10:11:19 -0500 |
commit | feabc12d384a448614dbc8a9a51cd39ee63b4a83 (patch) | |
tree | 3bb383fac7dc457b893f76d249e627a8fcee3fd0 | |
parent | a9998fc09e208b625edc7f39e1d6a49acb533f4b (diff) |
Fix usage of naïve datetime object
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | packages/views/search.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/views/search.py b/packages/views/search.py index 99bf703a..f7b8ed1d 100644 --- a/packages/views/search.py +++ b/packages/views/search.py @@ -1,5 +1,6 @@ from datetime import datetime import json +from pytz import utc from django import forms from django.contrib.admin.widgets import AdminDateWidget @@ -105,8 +106,9 @@ def parse_form(form, packages): if form.cleaned_data['last_update']: lu = form.cleaned_data['last_update'] - packages = packages.filter(last_update__gte= - datetime(lu.year, lu.month, lu.day, 0, 0)) + cutoff = datetime(lu.year, lu.month, lu.day, 0, 0) + cutoff = cutoff.replace(tzinfo=utc) + packages = packages.filter(last_update__gte=cutoff) if form.cleaned_data['name']: name = form.cleaned_data['name'] |