bodhi/controllers.py | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
New commits:
commit 840ef3f21f3ac3292e52d587401a2332f6515cb2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Mar 2 16:09:43 2011 -0500
Fix a bug that occurs when you remove a build from an update and add
a new one from a different release.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 91b59e6..6beaa7d 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -692,19 +692,12 @@ class Root(controllers.RootController):
# Make sure the tag has not been moved, which indicates that we
# are in the middle of pushing this update
if edited.get_implied_build_tag() not in
buildinfo[builds[0]]['tags']:
- if edited.request:
- flash_log("Unable to edit update. %s is currently tagged with %s
"
- "where bodhi expects it to be %s. This most likely
means "
- "that this update is currently being pushed." %
(
- builds[0], buildinfo[builds[0]]['tags'],
- edited.get_implied_build_tag()))
- raise InvalidUpdateException(params)
- else:
- log.warn('Mismatched tags for an update without a
request!?')
- log.debug(edited)
- log.debug('Implied tag: %s\nActual tags: %s' % (
- edited.get_implied_build_tag(),
- buildinfo[builds[0]]['tags']))
+ flash_log("Unable to edit update. %s is currently tagged with %s
"
+ "where bodhi expects it to be %s. This could mean "
+ "that this update is currently being pushed." % (
+ builds[0], buildinfo[builds[0]]['tags'],
+ edited.get_implied_build_tag()))
+ raise InvalidUpdateException(params)
# Determine which builds have been added or removed
edited_builds = [build.nvr for build in edited.builds]
commit f7d2a83d4248def052017024d3a1c756ac736c59
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Mar 2 15:10:09 2011 -0500
Readability tweak
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index b18fe17..91b59e6 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -716,8 +716,9 @@ class Root(controllers.RootController):
for build in edited_builds:
if build not in builds:
removed_builds.append(build)
+
+ # Comment on the update with details of added/removed builds
if new_builds or removed_builds:
- # Comment on the update with details of added/removed builds
comment = '%s has edited this update. ' %
identity.current.user_name
if new_builds:
comment += 'New build(s): %s. ' % ',
'.join(new_builds)