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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jan 29 10:39:38 CET 2010


Author: torsten
Date: 2010-01-29 10:39:35 +0100 (Fri, 29 Jan 2010)
New Revision: 1002

Modified:
   wasko/branches/2.0/waskaweb/controllers/caselifetime.py
Log:
* waskaweb/controllers/caselifetime.py
(CaselifetimeController.reopenAction): Basic workflow reestablished.
Saving using formed does not work yet.


Modified: wasko/branches/2.0/waskaweb/controllers/caselifetime.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/caselifetime.py	2010-01-29 09:11:29 UTC (rev 1001)
+++ wasko/branches/2.0/waskaweb/controllers/caselifetime.py	2010-01-29 09:39:35 UTC (rev 1002)
@@ -313,6 +313,7 @@
 
         try:
             if c.num_wiederaufnahme >= 1:
+                log.debug('a')
                 last_date = D(it, 'cm_wiederauf_datum_bis_1', case_id)
                 if last_date:
                     c.form_result['cm_wiederauf_datum_bis_2'] = \
@@ -320,6 +321,7 @@
                 else:
                     c.form_result['cm_wiederauf_datum_bis_2'] = ''
             if c.num_verlaengerung < 1:
+                log.debug('b')
                 begin_cm = D(it, 'datum_cm_start', case_id)
                 if begin_cm:
                     c.form_result['cm_datum_verlaengerung_1'] = \
@@ -328,6 +330,7 @@
                     c.form_result['cm_datum_verlaengerung_1'] = ''
 
             if c.num_verlaengerung  == 1:
+                log.debug('c')
                 ende_verl1 = D(it, 'cm_datum_verlaengerung_1', case_id)
                 if ende_verl1:
                     c.form_result['cm_datum_verlaengerung_2'] = \
@@ -336,10 +339,11 @@
                     c.form_result['cm_datum_verlaengerung_2'] = ''
 
         except Exception, err:
-            traceback.print_exc(file=sys.stderr)
+            log.exception(err)
             c.form_result['cm_wiederauf_datum_bis_2'] = ''
             c.form_result['cm_datum_verlaengerung_1'] = ''
             c.form_result['cm_datum_verlaengerung_2'] = ''
+        log.debug(c.form_result)
         return render('/caselifetime/overview.mako')
 
     def changeLifetime(self):
@@ -574,7 +578,11 @@
             return render('caselifetime/dialogs/confirm_reopen.mako')
 
     def reopenAction(self):
-        checkcase()
+        factory = InstanceFactory(g.formedTree, PostgresDBInterface())
+        it = factory.loadInstanceTreeByIdentifier(session['case'].id)
+        case_id = it.getRootNode().getIdentifier()
+        checkcase(it, case_id)
+        S = _set_data
         form_result = {}
         form_errors = {}
 
@@ -591,11 +599,10 @@
 
         try:
             form_result = validator.to_python(request.params)
-            print form_result
             session['lifetimeparams'] = form_result
             session.save()
             try:
-                c.casedata.setData(form_result, do_write=False)
+                S(it, form_result, case_id, do_write=False)
                 if (form_result.get('cm_wiederauf_genehm_1') == '1'
                     or form_result.get('cm_wiederauf_genehm_2') == '1'):
                     return self.reopen_ok(session['case'].id)
@@ -604,7 +611,6 @@
             except DataSaveException, err:
                 form_result_1, form_errors = err.toErrorDicts()
         except formencode.Invalid, error:
-            #print error
             form_result = error.value
             form_errors = error.error_dict or {}
 



More information about the Mpuls-commits mailing list