From a35e4a754f437977254262263d8e1476c5c18ebb Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 07 2015 10:33:42 +0000 Subject: Display the error message if pagure.lib.add_group raises an exception --- diff --git a/pagure/ui/groups.py b/pagure/ui/groups.py index 09c27c0..2dc4bcd 100644 --- a/pagure/ui/groups.py +++ b/pagure/ui/groups.py @@ -221,6 +221,9 @@ def add_group(): flask.flash('Group `%s` created.' % group_name) flask.flash(msg) return flask.redirect(flask.url_for('.group_lists')) + except pagure.exceptions.PagureException, err: + pagure.SESSION.rollback() + flask.flash(err.message, 'error') except SQLAlchemyError as err: # pragma: no cover pagure.SESSION.rollback() flask.flash('Could not create group.')