bodhi/controllers.py | 13 +++++++------ bodhi/tests/test_controllers.py | 1 + 2 files changed, 8 insertions(+), 6 deletions(-)
New commits: commit 2f97f98fd0389c5c2ded058b368b8d6840620bf3 Author: Luke Macken lmacken@redhat.com Date: Wed Jul 7 01:02:23 2010 -0400
Tweak a unit test to get it running again after the previous patch
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py index fe5804a..6b660ce 100644 --- a/bodhi/tests/test_controllers.py +++ b/bodhi/tests/test_controllers.py @@ -1048,6 +1048,7 @@ class TestControllers(testutil.DBTest): 'request' : 'Stable', 'stable_karma' : 1, 'unstable_karma' : 2, + 'autokarma': True, } testutil.capture_log('bodhi.util') self.save_update(params, session)
commit 6c7f4e5d428b409743fe462eb16e8df1f25ed277 Author: Till Maas opensource@till.name Date: Fri Jul 2 22:42:39 2010 +0200
Verify karma thresholds only if autokarma is True
diff --git a/bodhi/controllers.py b/bodhi/controllers.py index b7f1216..c602b0e 100644 --- a/bodhi/controllers.py +++ b/bodhi/controllers.py @@ -559,12 +559,13 @@ class Root(controllers.RootController): if request not in ('testing', 'stable', None): flash_log('Unknown request: %s. Valid requests are: testing, ' 'stable, None' % request) - if stable_karma < 1: - flash_log("Stable karma must be at least 1.") - raise InvalidUpdateException(params) - if stable_karma <= unstable_karma: - flash_log("Stable karma must be higher than unstable karma.") - raise InvalidUpdateException(params) + if autokarma: + if stable_karma < 1: + flash_log("Stable karma must be at least 1.") + raise InvalidUpdateException(params) + if stable_karma <= unstable_karma: + flash_log("Stable karma must be higher than unstable karma.") + raise InvalidUpdateException(params)
# Make sure this update doesn't already exist if not edited: