[Mpuls-commits] r3794 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Sep 27 20:30:08 CEST 2010


Author: bh
Date: 2010-09-27 20:30:07 +0200 (Mon, 27 Sep 2010)
New Revision: 3794

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
* mpulsweb/controllers/formularpage.py: Introduce case_id variable
to avoid duplicating the code to retrieve it.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-09-27 16:23:47 UTC (rev 3793)
+++ base/trunk/ChangeLog	2010-09-27 18:30:07 UTC (rev 3794)
@@ -1,5 +1,10 @@
 2010-09-27  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/controllers/formularpage.py: Introduce case_id variable
+	to avoid duplicating the code to retrieve it.
+
+2010-09-27  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/controllers/formularpage.py (FormularpageController.save)
 	(FormularpageController._check_case_validity): Move the validity
 	checking code from the save method into the new method

Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2010-09-27 16:23:47 UTC (rev 3793)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2010-09-27 18:30:07 UTC (rev 3794)
@@ -190,14 +190,16 @@
 
     @checkRole(('cm_ka'))
     def save(self):
+        case_id = session['case'].id
         factory = InstanceFactory(g.formedTree, PostgresDBInterface())
         instance_tree = factory.loadInstanceTreeByIdentifier(
-            session['case'].id,
+            case_id,
             session.get('uncommited_fields'))
         page_id = request.params['page']
         try:
             form_result = convert2dic(request.params)
             apply_hidden_booleans(form_result)
+
             instance_tree.setData(form_result)
             session['uncommited_fields'] = instance_tree.commit()
             session.save()
@@ -209,7 +211,7 @@
                 page_id = session['navigation.tree'].getTreeItem(page_id).nextKey().key
 
             # Check consistence of case and retag
-            self._check_case_validity(session['case'].id)
+            self._check_case_validity(case_id)
 
         except SetDataException, err:
             # Do nothing than setting the status message. In the future the



More information about the Mpuls-commits mailing list