summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-02 18:29:35 -0600
committerDan McGee <dan@archlinux.org>2012-02-07 00:47:21 -0600
commitb2cfd30094b07546bbbdd2c83499cfd3d03f2161 (patch)
treed2a86ecad4fa30a1b3e0712528eb97e088025b11 /main
parent087aca5cceb2dc8ac4625eb61f95b57b704bd30f (diff)
downloadarchweb-b2cfd30094b07546bbbdd2c83499cfd3d03f2161.tar.gz
archweb-b2cfd30094b07546bbbdd2c83499cfd3d03f2161.zip
Show the latest flag request on package details if out of date
This only shows up for logged in users, but might be helpful for developers browsing around the site, especially if they did not receive the email themselves, or in the case of orphan packages. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/models.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index d72f2c05..15a92662 100644
--- a/main/models.py
+++ b/main/models.py
@@ -312,6 +312,17 @@ class Package(models.Model):
repo__testing=self.repo.testing, repo__staging=self.repo.staging,
pkgbase=self.pkgbase).exclude(id=self.id)
+ def flag_request(self):
+ if not self.flag_date:
+ return None
+ from packages.models import FlagRequest
+ try:
+ request = FlagRequest.objects.filter(pkgbase=self.pkgbase,
+ repo=self.repo).latest()
+ return request
+ except FlagRequest.DoesNotExist:
+ return None
+
def is_same_version(self, other):
'is this package similar, name and version-wise, to another'
return self.pkgname == other.pkgname \