summaryrefslogtreecommitdiff
path: root/devel/views.py
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2011-08-03 16:01:52 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2011-08-03 16:01:52 -0300
commita8b2fc84ba96c83ec1addf89ac04608fbf572705 (patch)
tree6f54cbe43b8684908f2e80ba311272c06fd0fd08 /devel/views.py
parent294bf173236610fc8c308f81d8617e7e0d0e4bff (diff)
parentb0bad20756549df5edf726771c8e6869caba6244 (diff)
Merge branch 'master' of git://projects.archlinux.org/archweb
Conflicts: templates/base.html
Diffstat (limited to 'devel/views.py')
-rw-r--r--devel/views.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/devel/views.py b/devel/views.py
index 89963d27..3bf68a58 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -32,7 +32,7 @@ from string import ascii_letters, digits
def index(request):
'''the developer dashboard'''
inner_q = PackageRelation.objects.filter(user=request.user).values('pkgbase')
- flagged = Package.objects.select_related('arch', 'repo').filter(
+ flagged = Package.objects.normal().filter(
flag_date__isnull=False, pkgbase__in=inner_q).order_by('pkgname')
todopkgs = TodolistPkg.objects.select_related(
@@ -102,6 +102,13 @@ class ProfileForm(forms.Form):
return self.cleaned_data
class UserProfileForm(forms.ModelForm):
+ def clean_pgp_key(self):
+ data = self.cleaned_data['pgp_key']
+ # strip 0x prefix if provided; store uppercase
+ if data.startswith('0x'):
+ data = data[2:]
+ return data.upper()
+
class Meta:
model = UserProfile
exclude = ['allowed_repos', 'user']
@@ -128,14 +135,19 @@ def change_profile(request):
@login_required
def report(request, report, username=None):
title = 'Developer Report'
- packages = Package.objects.select_related('arch', 'repo')
+ packages = Package.objects.normal()
names = attrs = user = None
if report == 'old':
title = 'Packages last built more than two years ago'
- cutoff = datetime.now() - timedelta(days=730)
+ cutoff = datetime.now() - timedelta(days=365 * 2)
packages = packages.filter(
build_date__lt=cutoff).order_by('build_date')
+ elif report == 'long-out-of-date':
+ title = 'Packages marked out-of-date more than 90 days ago'
+ cutoff = datetime.now() - timedelta(days=90)
+ packages = packages.filter(
+ flag_date__lt=cutoff).order_by('flag_date')
elif report == 'big':
title = 'Packages with compressed size > 50 MiB'
cutoff = 50 * 1024 * 1024