From ea8d98bec395dfa0e51cd1c681cf76fb69802206 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 29 2014 12:33:21 +0000 Subject: Try to commit to the DB every tag one by one and report error/success --- diff --git a/progit/ui/issues.py b/progit/ui/issues.py index 41442ac..b33f4dc 100644 --- a/progit/ui/issues.py +++ b/progit/ui/issues.py @@ -104,20 +104,13 @@ def add_tag_issue(repo, issueid, username=None, chrome=True): user=flask.g.fas_user.username, ticketfolder=APP.config['TICKETS_FOLDER'], ) + SESSION.commit() + msg = 'Tag %s added' % tag.strip() + flask.flash(msg) except SQLAlchemyError, err: # pragma: no cover SESSION.rollback() flask.flash(str(err), 'error') - try: - SESSION.commit() - msg = 'Tags %s added' % tags - flask.flash(msg) - except SQLAlchemyError, err: # pragma: no cover - SESSION.rollback() - msg = str(err) - cat = 'error' - flask.flash(msg, cat) - if not chrome: if cat is not None: output = {'output': 'notok', 'message': msg}