[Mpuls-commits] r5343 - base/trunk/mpulsweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Sep 15 12:21:30 CEST 2011
Author: bh
Date: 2011-09-15 12:21:28 +0200 (Thu, 15 Sep 2011)
New Revision: 5343
Modified:
base/trunk/mpulsweb/controllers/case.py
Log:
Port MetaException handler for CaseController.delete from WASKU.
The handler is copied from WASKU web revision 419:ce88dff87fbb. In
WASKU the handler was in the _do_delete_case method, but it seems better
in mpulsweb to put it into the delete method around the _do_delete_case
call because that way, derived applications could provide their own
exception handler in _do_delete_case that overrides what the exception
handler in the base does.
Modified: base/trunk/mpulsweb/controllers/case.py
===================================================================
--- base/trunk/mpulsweb/controllers/case.py 2011-09-15 09:59:16 UTC (rev 5342)
+++ base/trunk/mpulsweb/controllers/case.py 2011-09-15 10:21:28 UTC (rev 5343)
@@ -143,6 +143,17 @@
case = self._loadCase(id)
try:
return self._do_delete_case(case)
+ except MetaException, exc:
+ log.exception("Could not delete case because of a problem with the"
+ " meta server")
+ return self._meta_error(case, exc,
+ _("Case document not deleted!"),
+ _("The case can not be deleted because"
+ " of an unexpected problem with the"
+ " meta server."),
+ h.url_for(controller="/case_overview"),
+ '/casemanagement/dialogs'
+ '/failed_delete.mako')
except Exception:
log.exception("Exception while trying to delete case %d", case.id)
c.dialog_title = _("Case document not deleted!")
More information about the Mpuls-commits
mailing list