[Mpuls-commits] r5626 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 18 22:09:48 CET 2011


Author: bh
Date: 2011-11-18 22:09:43 +0100 (Fri, 18 Nov 2011)
New Revision: 5626

Modified:
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
Extract the page rendering abstraction from Formularpage.select
into the new method _render_page. Other methods in Formularpage will use
this method instead of calling the select method to render the page.


Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2011-11-18 21:03:05 UTC (rev 5625)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2011-11-18 21:09:43 UTC (rev 5626)
@@ -113,11 +113,14 @@
         # or, return a response
         return 'Hello World'
 
+    def _render_page(self, case, page_id):
+        c.formular = get_rendered_page(page_id,
+                                       case.get_formed_instance_tree())
+        return render('/formularpage/formular.mako')
+
     @checkRole(('admin', 'cm', 'pt_dlr'))
     def select(self, id):
-        case = self._load_current_case(read_only=True)
-        c.formular = get_rendered_page(id, case.get_formed_instance_tree())
-        return render('/formularpage/formular.mako')
+        return self._render_page(self._load_current_case(read_only=True), id)
 
     @checkRole(('cm'))
     def edit(self, id):



More information about the Mpuls-commits mailing list