summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-03 21:32:30 -0500
committerDan McGee <dan@archlinux.org>2011-11-03 21:32:30 -0500
commit0aa42e2c01df2bf1c9e425994420f5ae10252597 (patch)
tree8c1b302064748dfe4736dac7659157a162b5f87a
parent5e295a3dbb0b64f229e9419384721b154e013b9e (diff)
downloadarchweb-0aa42e2c01df2bf1c9e425994420f5ae10252597.tar.gz
archweb-0aa42e2c01df2bf1c9e425994420f5ae10252597.zip
Allow signoff manipulation if you are a maintainer
This is a more expensive and not-yet-optimized way of doing this, but we can fix that later as needed. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--packages/utils.py4
-rw-r--r--templates/packages/signoff_cell.html2
-rw-r--r--templates/todolists/view.html2
3 files changed, 6 insertions, 2 deletions
diff --git a/packages/utils.py b/packages/utils.py
index 60b95e21..1a2c0de0 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -2,6 +2,7 @@ from operator import itemgetter
from django.db import connection
from django.db.models import Count, Max
+from django.contrib.auth.models import User
from main.models import Package, Repo
from main.utils import cache_function, groupby_preserve_order, PackageStandin
@@ -172,6 +173,9 @@ class PackageSignoffGroup(object):
self.version = ''
self.last_update = first.last_update
self.packager = first.packager
+ self.maintainers = User.objects.filter(
+ package_relations__type=PackageRelation.MAINTAINER,
+ package_relations__pkgbase=self.pkgbase)
self.specification = \
SignoffSpecification.objects.get_or_default_from_package(first)
diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html
index 4f9f726b..0bf44ca2 100644
--- a/templates/packages/signoff_cell.html
+++ b/templates/packages/signoff_cell.html
@@ -17,7 +17,7 @@
title="Signoff {{ group.pkgbase }} for {{ group.arch }}">Signoff</a></div>
{% endif %}
{% endif %}
-{% if group.packager == user %}
+{% if user == group.packager or user in group.maintainers %}
<div>
<a class="signoff-options" href="{{ group.package.get_absolute_url }}signoff/options/">Signoff Options</a>
</div>
diff --git a/templates/todolists/view.html b/templates/todolists/view.html
index 8f515c9b..c9ea919a 100644
--- a/templates/todolists/view.html
+++ b/templates/todolists/view.html
@@ -29,7 +29,7 @@
<th>Name</th>
<th>Arch</th>
<th>Repo</th>
- <th>Maintainer</th>
+ <th>Maintainers</th>
<th>Status</th>
</tr>
</thead>