[Mpuls-commits] r1037 - wasko/branches/2.0/waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 1 11:14:27 CET 2010


Author: torsten
Date: 2010-02-01 11:14:26 +0100 (Mon, 01 Feb 2010)
New Revision: 1037

Modified:
   wasko/branches/2.0/waskaweb/controllers/caselifetime.py
Log:
* waskaweb/controllers/caselifetime.py (DataSaveException): New. Moved
from casedocument.py. This is exception is only used in connection
with "Neuaufnahme" and "Wiederaufnahme". This exception is not thrown
anywhere, so this is broken. Changed import.


Modified: wasko/branches/2.0/waskaweb/controllers/caselifetime.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/caselifetime.py	2010-02-01 10:05:49 UTC (rev 1036)
+++ wasko/branches/2.0/waskaweb/controllers/caselifetime.py	2010-02-01 10:14:26 UTC (rev 1037)
@@ -17,7 +17,6 @@
 
 from waskaweb.model.case import CaseFactory
 from waskaweb.model.logbook import Logbook, LogbookEntry
-from waskaweb.model.casedocument import DataSaveException
 from waskaweb.model.datapage import DataExtractor
 from waskaweb.controllers.CaseBase import CasebaseController
 
@@ -99,7 +98,28 @@
 Löschen vorgelegt.'''
 ABORT_HEADER_CONFIRM = u'Eingangsdokumentation abbrechen?'
 
+class DataSaveException(Exception):
 
+    def __init__(self, desc, errors = None):
+        Exception.__init__(self, desc)
+        self.errors = errors
+
+    def toErrorDicts(self):
+
+        values, errors = {}, {}
+
+        for key, value, error in self.errors:
+            values[key] = value
+            try:
+                old = errors[key]
+                errors[key] = u"%s, %s" % (old, error)
+            except KeyError:
+                errors[key] = error
+
+        return values, errors
+
+
+
 def create_logbook(id=None, header=None, text=None):
     if id is None:
         id = session['case'].id



More information about the Mpuls-commits mailing list