From: philipp Date: Mon, 17 Mar 2014 22:02:55 +0000 (+0000) Subject: When updating the inns, multiple errors in a Gasthausbox are now separated by ';'. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wradmin.git/commitdiff_plain/6fac7aace32933074ac75ff9ee9d7bcdab9e7ab5 When updating the inns, multiple errors in a Gasthausbox are now separated by ';'. git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@1944 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- diff --git a/wradmin/controllers/gasthaus.py b/wradmin/controllers/gasthaus.py index 378e5b9..16ce6c9 100644 --- a/wradmin/controllers/gasthaus.py +++ b/wradmin/controllers/gasthaus.py @@ -14,6 +14,7 @@ import re import wrpylib.wrmwmarkup import wrpylib.wrmwcache +import wrpylib.mwapi log = logging.getLogger(__name__) @@ -43,7 +44,11 @@ class GasthausController(BaseController): model.meta.Session.commit() session['flash'] = u'Die Gasthausliste wurde erfolgreich aktualisiert.' except wrpylib.wrmwcache.UpdateCacheError as e: - if len(e.args) == 3: session['flash'] = u"Fehler bei Gasthaus '{0}': {1}".format(e.args[1], e.args[2]) + title = unicode(e.args[1]) + title = wrpylib.mwapi.to_title(title) + msg = unicode(e.args[2]) + msg = msg.replace('\n', '; ') + if len(e.args) == 3: session['flash'] = u"Fehler bei Gasthaus '{0}': {1}".format(title, msg) else: session['flash'] = unicode(e) session.save() # Redirect to result page