summaryrefslogtreecommitdiff
path: root/devel/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-24 09:19:48 -0500
committerDan McGee <dan@archlinux.org>2012-07-24 19:57:20 -0500
commitc0bf9e20660cfae7ea8994472555bba23398b598 (patch)
tree889351fc02d4930233acf3dace3ececda4833c88 /devel/views.py
parent61b4098c611592d62b40a9ee941976a869dff4fc (diff)
Remove custom utc_now() function, use django.utils.timezone.now()
This was around from the time when we handled timezones sanely and Django did not; now that we are on 1.4 we no longer need our own code to handle this. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel/views.py')
-rw-r--r--devel/views.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/devel/views.py b/devel/views.py
index 78ed26f2..143b12bf 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -24,11 +24,11 @@ from django.views.decorators.cache import never_cache
from django.views.generic.simple import direct_to_template
from django.utils.encoding import force_unicode
from django.utils.http import http_date
+from django.utils.timezone import now
from .models import UserProfile
from main.models import Package, PackageFile, TodolistPkg
from main.models import Arch, Repo
-from main.utils import utc_now
from news.models import News
from packages.models import PackageRelation, Signoff, Depend
from packages.utils import get_signoff_groups
@@ -122,15 +122,15 @@ def clock(request):
else:
dev.last_action = None
- now = utc_now()
+ current_time = now()
page_dict = {
'developers': devs,
- 'utc_now': now,
+ 'utc_now': current_time,
}
response = direct_to_template(request, 'devel/clock.html', page_dict)
if not response.has_header('Expires'):
- expire_time = now.replace(second=0, microsecond=0)
+ expire_time = current_time.replace(second=0, microsecond=0)
expire_time += timedelta(minutes=1)
expire_time = time.mktime(expire_time.timetuple())
response['Expires'] = http_date(expire_time)
@@ -198,12 +198,12 @@ def report(request, report_name, username=None):
if report_name == 'old':
title = 'Packages last built more than one year ago'
- cutoff = utc_now() - timedelta(days=365)
+ cutoff = now() - timedelta(days=365)
packages = packages.filter(
build_date__lt=cutoff).order_by('build_date')
elif report_name == 'long-out-of-date':
title = 'Packages marked out-of-date more than 90 days ago'
- cutoff = utc_now() - timedelta(days=90)
+ cutoff = now() - timedelta(days=90)
packages = packages.filter(
flag_date__lt=cutoff).order_by('flag_date')
elif report_name == 'big':