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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 31 20:55:21 CEST 2010


Author: bh
Date: 2010-08-31 20:55:18 +0200 (Tue, 31 Aug 2010)
New Revision: 3500

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/case_bundle.py
Log:
* mpulsweb/controllers/case_bundle.py
(CaseBundleController._build_casebundle): Use
search_options_from_session instead of equivalent duplicated
inline code


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-08-31 18:53:40 UTC (rev 3499)
+++ base/trunk/ChangeLog	2010-08-31 18:55:18 UTC (rev 3500)
@@ -1,5 +1,12 @@
 2010-08-31  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/controllers/case_bundle.py
+	(CaseBundleController._build_casebundle): Use
+	search_options_from_session instead of equivalent duplicated
+	inline code
+
+2010-08-31  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/controllers/case_overview.py
 	(search_options_from_session, CaseOverviewController.overview):
 	Move some code shared with case_bundle.py to the new function

Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py	2010-08-31 18:53:40 UTC (rev 3499)
+++ base/trunk/mpulsweb/controllers/case_bundle.py	2010-08-31 18:55:18 UTC (rev 3500)
@@ -19,7 +19,8 @@
 from mpulsweb.model.user import UserGroupList, UserListObject, UserObject
 from mpulsweb.model.case import MpulsCaseBundle, MpulsCaseOverview
 from mpulsweb.model.phase import ConsistenceCheckException
-from mpulsweb.controllers.case_overview import parseSearchOptions
+from mpulsweb.controllers.case_overview import parseSearchOptions, \
+     search_options_from_session
 
 
 log = logging.getLogger(__name__)
@@ -227,17 +228,7 @@
             # Narf! Load ids of all cases with the last search
             # option again as they are not included in the submitted
             # data.
-
-            # If the user is admin then he should see only cases
-            # which are marked for deletion or anonymisation
-            if user.isAdmin():
-                FORM_DEFAULTS = g.mpuls_config.get('search',
-                                                   'admin_defaults')[0]
-            else:
-                FORM_DEFAULTS = g.mpuls_config.get('search', 'cm_defaults')[0]
-
-            search_options = (session.get('CASE_OVERVIEW_SEARCHOPTIONS')
-                              or FORM_DEFAULTS)
+            search_options = search_options_from_session()
             search = parseSearchOptions(search_options)
             case_bundle = MpulsCaseBundle([case.id for case in
                                            MpulsCaseOverview().search(search)])



More information about the Mpuls-commits mailing list