[Mpuls-commits] r5585 - in base/trunk/mpulsweb: controllers templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 15 16:35:04 CET 2011


Author: torsten
Date: 2011-11-15 16:35:03 +0100 (Tue, 15 Nov 2011)
New Revision: 5585

Modified:
   base/trunk/mpulsweb/controllers/case_overview.py
   base/trunk/mpulsweb/templates/casemanagement/caselist.mako
Log:
Do not load a editor-object every time when we only need the id of the editor.
In this case use the preloaded editor_id attribute.


Modified: base/trunk/mpulsweb/controllers/case_overview.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_overview.py	2011-11-15 15:33:08 UTC (rev 5584)
+++ base/trunk/mpulsweb/controllers/case_overview.py	2011-11-15 15:35:03 UTC (rev 5585)
@@ -118,7 +118,7 @@
         #count num of cases
         c.count_all = len([x for x in cases.getDatasets()])
         c.count_own = len([x for x in cases.getDatasets()
-                           if x.getEditor().id == user.id])
+                           if x.editor_id == user.id])
         c.count_standin = c.count_all - c.count_own
         c.count_anon = len([x for x in cases.getDatasets()
                                 if x.getState().getState() == 5])

Modified: base/trunk/mpulsweb/templates/casemanagement/caselist.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2011-11-15 15:33:08 UTC (rev 5584)
+++ base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2011-11-15 15:35:03 UTC (rev 5585)
@@ -161,7 +161,7 @@
 
 <%def name="get_state_icon(case)">
   % if h.hasRole(['cm']) and g.mpuls_config.is_enabled('case-module', 'organisation'):
-    % if str(case.getEditor().id) == str(session.get('USER_AUTHORIZED').id):
+    % if str(case.editor_id) == str(session.get('USER_AUTHORIZED').id):
       <img src    = "${h.url_for('/images/icons/edit_editor.png')}"
            border = "0"
            alt    = "${_('Editor')}"



More information about the Mpuls-commits mailing list