summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Macken <lmacken@redhat.com>2011-01-17 17:11:11 (GMT)
committerLuke Macken <lmacken@redhat.com>2011-01-17 17:12:13 (GMT)
commitd6218003bda6ce41f85d1a71260aa4152ec63b41 (patch)
treed8e89bf8bdd6680d88e34937c0e5b74269dd231b
parent24be4fc942fb191f72d5b32eaa4a17c33d55dbe3 (diff)
downloadbodhi-d6218003bda6ce41f85d1a71260aa4152ec63b41.zip
bodhi-d6218003bda6ce41f85d1a71260aa4152ec63b41.tar.gz
bodhi-d6218003bda6ce41f85d1a71260aa4152ec63b41.tar.xz
Add the appropriate pending tag upon reaching stablekarma.
Also, remove the pending tags when revoking a request.
-rw-r--r--bodhi/controllers.py4
-rw-r--r--bodhi/model.py12
2 files changed, 16 insertions, 0 deletions
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index f323291..1dab04e 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -439,6 +439,10 @@ class Root(controllers.RootController):
raise redirect(update.get_url())
flash_log("%s request revoked" % update.request.title())
mail.send_admin('revoke', update)
+ if update.request == 'testing':
+ update.remove_tag(update.release.pending_testing_tag)
+ elif update.request == 'stable':
+ update.remove_tag(update.release.pending_stable_tag)
update.request = None
raise redirect(update.get_url())
diff --git a/bodhi/model.py b/bodhi/model.py
index 768b003..b9c59a1 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -807,6 +807,10 @@ class PackageUpdate(SQLObject):
# stable once it has met the requirements.
if (self.stable_karma < min_karma and self.critpath_approved and
self.karma >= min_karma and self.pushable):
+ if self.request == 'testing':
+ self.remove_tag(self.release.pending_testing_tag)
+ if self.request != 'stable':
+ self.add_tag(self.release.pending_stable_tag)
self.request = 'stable'
self.comment(config.get('stablekarma_comment'), author='bodhi')
mail.send(self.submitter, 'stablekarma', self)
@@ -816,6 +820,10 @@ class PackageUpdate(SQLObject):
if (self.critpath_approved and self.pushable and
self.karma >= self.stable_karma and
self.karma >= min_karma):
+ if self.request == 'testing':
+ self.remove_tag(self.release.pending_testing_tag)
+ if self.request != 'stable':
+ self.add_tag(self.release.pending_stable_tag)
self.request = 'stable'
self.comment(config.get('stablekarma_comment'), author='bodhi')
mail.send(self.submitter, 'stablekarma', self)
@@ -824,6 +832,10 @@ class PackageUpdate(SQLObject):
if self.stable_karma != 0 and self.stable_karma == self.karma:
if self.pushable:
log.info("Automatically marking %s as stable" % self.title)
+ if self.request == 'testing':
+ self.remove_tag(self.release.pending_testing_tag)
+ if self.request != 'stable':
+ self.add_tag(self.release.pending_stable_tag)
self.request = 'stable'
self.pushed = False
#self.date_pushed = None