summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-08 22:21:05 -0500
committerDan McGee <dan@archlinux.org>2012-08-08 22:21:05 -0500
commitb425b192e12afd0584bbffc9ff1d997a330bcd5a (patch)
treee4b1c03634080308cc9595cfa249ca6a6b163ac5 /main
parentad05f3eb2c8511c63dbdc9378bf3561ab949e940 (diff)
Migrate flag request version info to new format
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/models.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/models.py b/main/models.py
index bb2320e8..95e3c42b 100644
--- a/main/models.py
+++ b/main/models.py
@@ -345,12 +345,16 @@ class Package(models.Model):
pkgbase=self.pkgbase).exclude(id=self.id)
def flag_request(self):
- if not self.flag_date:
+ if self.flag_date is None:
return None
from packages.models import FlagRequest
try:
+ # Note that we don't match on pkgrel here; this is because a pkgrel
+ # bump does not unflag a package so we can still show the same flag
+ # request from a different pkgrel.
request = FlagRequest.objects.filter(pkgbase=self.pkgbase,
- repo=self.repo).latest()
+ repo=self.repo, pkgver=self.pkgver,
+ epoch=self.epoch).latest()
return request
except FlagRequest.DoesNotExist:
return None