]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
When updating the inns, multiple errors in a Gasthausbox are now separated by ';'.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 17 Mar 2014 22:02:55 +0000 (22:02 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 17 Mar 2014 22:02:55 +0000 (22:02 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@1944 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wradmin/controllers/gasthaus.py

index 378e5b9283b728b7e8d7be17481bd56704909e7c..16ce6c923491c0d7dcbfd8af22091f77f1d832c2 100644 (file)
@@ -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