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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Nov 17 22:01:13 CET 2011


Author: bh
Date: 2011-11-17 22:01:10 +0100 (Thu, 17 Nov 2011)
New Revision: 5595

Modified:
   base/trunk/mpulsweb/controllers/case.py
Log:
Remove the CaseController.init_case. Use _loadCase instead.
Since revision 2343 init_case only called _loadCase anyway. Update the
callers to call _loadCase directly. By calling _loadCase directly they
will also be able to better specify whether they need only read-only
access.


Modified: base/trunk/mpulsweb/controllers/case.py
===================================================================
--- base/trunk/mpulsweb/controllers/case.py	2011-11-17 20:45:54 UTC (rev 5594)
+++ base/trunk/mpulsweb/controllers/case.py	2011-11-17 21:01:10 UTC (rev 5595)
@@ -38,11 +38,6 @@
 
 class CaseController(BaseController):
 
-    def init_case(self, id):
-        '''Return a case object'''
-        case = self._loadCase(id)
-        return case
-
     @checkRole(('admin', 'cm', 'pt_dlr'))
     def index(self):
         redirect_to(controller="/case_overview")
@@ -55,7 +50,7 @@
     @checkRole(('admin', 'cm', 'pt_dlr'))
     def digest(self, id):
         id = self._checkInt(id)
-        case = self.init_case(id)
+        case = self._loadCase(id)
         c.case = case
         c.last_access = case.getState().getAccessTime()
         c.daysToMaxSavetime = case.getState().daysToMaxSavetime()
@@ -803,7 +798,7 @@
         form_defaults['notice'] = _('Please enter the reason for the case'
                                     ' storage extension.')
         id = self._checkInt(id)
-        case = self.init_case(id)
+        case = self._loadCase(id)
         c.entry = entry
         c.form_errors = {}
         form = render('/logbook/new.mako')



More information about the Mpuls-commits mailing list