[copr] master: The permission can no longer be raised, the function is safe because form can only return 0 or 1 from checkbox (327b1f2)

bkabrda at fedoraproject.org bkabrda at fedoraproject.org
Fri Jan 11 10:21:28 UTC 2013


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : master

>---------------------------------------------------------------

commit 327b1f27cf3ced08cac82e5c2d33ceb0d91ccb31
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Fri Jan 11 11:16:47 2013 +0100

    The permission can no longer be raised, the function is safe because form can only return 0 or 1 from checkbox


>---------------------------------------------------------------

 .../coprs/views/coprs_ns/coprs_general.py          |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 54896fe..1293763 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -172,13 +172,9 @@ def copr_permissions_applier_change(username, coprname):
         # we rely on these to be 0 or 1 from form. TODO: abstract from that
         new_builder = applier_permissions_form.copr_builder.data
         new_admin = applier_permissions_form.copr_admin.data
-        try:
-            coprs_logic.CoprsPermissionLogic.update_permissions_by_applier(flask.g.user, copr, permission, new_builder, new_admin)
-        except exceptions.InsufficientRightsException as ex:
-            flask.flash(ex.message)
-        else:
-            flask.flash('Successfuly updated permissions do Copr "{0}".'.format(copr.name))
+        coprs_logic.CoprsPermissionLogic.update_permissions_by_applier(flask.g.user, copr, permission, new_builder, new_admin)
         db.session.commit()
+        flask.flash('Successfuly updated permissions do Copr "{0}".'.format(copr.name))
 
     return flask.redirect(flask.url_for('coprs_ns.copr_detail', username = copr.owner.name, coprname = copr.name))
 



More information about the copr-devel mailing list