bodhi/controllers.py | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
New commits:
commit 090d2c84041e63e1dcebd99115292f7473529c32
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Sep 13 17:07:14 2010 -0400
More fixes for the edit functionality.
- Only refresh the koji tags if we need to
- If we edit an update and don't have to mess with tags,
then later on assume it's still tagged as testing.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index e0c6eda..29c1ee7 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -662,6 +662,7 @@ class Root(controllers.RootController):
# If we're editing an update, unpush it first so we can assume all
# of the builds are tagged as update candidates
+ edited_testing_update = False
if edited:
try:
edited = PackageUpdate.byTitle(edited)
@@ -713,15 +714,15 @@ class Root(controllers.RootController):
# Make sure all builds are tagged as updates-candidate
# and bring the update back to a pending state
edited.unpush()
+
+ # Refresh the tags for these builds
+ for build in edited.builds:
+ if build.nvr in buildinfo:
+ buildinfo[build.nvr]['tags'] = [tag['name'] for
tag in
+ koji.listTags(build.nvr)]
else:
# No need to change the bodhi state or koji tag
- pass
-
- # Refresh the tags for these builds
- for build in edited.builds:
- if build.nvr in buildinfo:
- buildinfo[build.nvr]['tags'] = [tag['name'] for tag
in
- koji.listTags(build.nvr)]
+ edited_testing_update = True
# Make sure all builds are tagged appropriately. We also determine
# which builds get pushed for which releases, based on the tag.
@@ -733,6 +734,9 @@ class Root(controllers.RootController):
for tag in tags:
rel = None
for r in Release.select():
+ if edited_testing_update and tag == r.testing_tag:
+ rel = r
+ break
if tag == r.candidate_tag:
rel = r
break
Show replies by date