summaryrefslogtreecommitdiff
path: root/devel/views.py
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-12-12 20:18:51 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-12-12 20:18:51 -0500
commit6c5c3355a97d35afb7f1eee284966ad0bf8cee3b (patch)
tree8c68a1c118209a7d18c60d9c3c6960a6ae051bcf /devel/views.py
parent03558d8b474d91be6cf21310916672ed62e920b7 (diff)
parent5d9f87c02bd8ad73fdb27600e0afe71284e3082f (diff)
Merge tag 'release_2012-04-07'
I hate writing tag messages. Conflicts: packages/templatetags/package_extras.py templates/packages/flag.html templates/packages/flaghelp.html templates/public/download.html templates/public/index.html templates/public/svn.html
Diffstat (limited to 'devel/views.py')
-rw-r--r--devel/views.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/devel/views.py b/devel/views.py
index f2c3949c..2b003bf7 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import date, datetime, timedelta
import operator
import pytz
import random
@@ -28,7 +28,7 @@ from main.utils import utc_now
from packages.models import PackageRelation
from packages.utils import get_signoff_groups
from todolists.utils import get_annotated_todolists
-from .utils import get_annotated_maintainers
+from .utils import get_annotated_maintainers, UserFinder
@login_required
@@ -232,6 +232,25 @@ def report(request, report_name, username=None):
# The two separate calls to exclude is required to do the right thing
packages = packages.exclude(pkgbase__in=owned).exclude(
pkgname__in=required)
+ elif report_name == 'mismatched-signature':
+ title = 'Packages with mismatched signatures'
+ names = [ 'Signature Date', 'Signed By', 'Packager' ]
+ attrs = [ 'sig_date', 'sig_by', 'packager' ]
+ cutoff = timedelta(hours=24)
+ finder = UserFinder()
+ filtered = []
+ packages = packages.filter(pgp_signature__isnull=False)
+ for package in packages:
+ sig_date = package.signature.datetime.replace(tzinfo=pytz.utc)
+ package.sig_date = sig_date.date()
+ key_id = package.signature.key_id
+ signer = finder.find_by_pgp_key(key_id)
+ package.sig_by = signer or key_id
+ if signer is None or signer.id != package.packager_id:
+ filtered.append(package)
+ elif sig_date > package.build_date + cutoff:
+ filtered.append(package)
+ packages = filtered
else:
raise Http404