summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-09-30 17:11:19 +0200
committerDan McGee <dan@archlinux.org>2012-09-30 17:11:19 +0200
commitfeabc12d384a448614dbc8a9a51cd39ee63b4a83 (patch)
tree3bb383fac7dc457b893f76d249e627a8fcee3fd0 /packages
parenta9998fc09e208b625edc7f39e1d6a49acb533f4b (diff)
downloadarchweb-feabc12d384a448614dbc8a9a51cd39ee63b4a83.tar.gz
archweb-feabc12d384a448614dbc8a9a51cd39ee63b4a83.tar.xz
Fix usage of naïve datetime object
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/views/search.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/views/search.py b/packages/views/search.py
index 99bf703..f7b8ed1 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']