summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-12-12 19:39:46 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-12-12 19:39:46 -0500
commit482ada7da21540dc62a1daeed4963bd591a77e00 (patch)
treeefb3fc5b14bdb2f8838dfc37b09c56f3c6a2ae8c /main
parentcdfa6c1195bb6feb812bffc981183f0758ca5e2f (diff)
parentcbdcb08557112f53ddcf074b950ee0950e12a045 (diff)
Merge tag 'release_2012-04-02'
Signing page changes, other tweaks Conflicts: README local_settings.py.example requirements_prod.txt urls.py
Diffstat (limited to 'main')
-rw-r--r--main/models.py4
-rw-r--r--main/templatetags/pgp.py8
2 files changed, 10 insertions, 2 deletions
diff --git a/main/models.py b/main/models.py
index 289cbb84..34cbcd17 100644
--- a/main/models.py
+++ b/main/models.py
@@ -288,7 +288,7 @@ class Package(models.Model):
if not self.arch.agnostic:
arches = self.applicable_arches()
# TODO: we can use list comprehension and an 'in' query to make this more effective
- for dep in self.packagedepend_set.order_by('optional', 'depname'):
+ for dep in self.depends.order_by('optional', 'depname'):
pkg = dep.get_best_satisfier(arches, testing=self.repo.testing,
staging=self.repo.staging)
providers = None
@@ -391,7 +391,7 @@ class PackageFile(models.Model):
db_table = 'package_files'
class PackageDepend(models.Model):
- pkg = models.ForeignKey(Package)
+ pkg = models.ForeignKey(Package, related_name='depends')
depname = models.CharField(max_length=255, db_index=True)
depvcmp = models.CharField(max_length=255, default='')
optional = models.BooleanField(default=False)
diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py
index 1ffc5241..50b1aa17 100644
--- a/main/templatetags/pgp.py
+++ b/main/templatetags/pgp.py
@@ -50,4 +50,12 @@ def pgp_fingerprint(key_id, autoescape=True):
return mark_safe(format_key(esc(key_id)))
pgp_fingerprint.needs_autoescape = True
+
+@register.assignment_tag
+def signature_exists(signatures, signer, signee):
+ if not signer or not signee:
+ return False
+ lookup = (signer[-16:], signee[-16:])
+ return lookup in signatures
+
# vim: set ts=4 sw=4 et: