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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Sep 14 21:15:09 CEST 2010


Author: bh
Date: 2010-09-14 21:15:06 +0200 (Tue, 14 Sep 2010)
New Revision: 3636

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/case_bundle.py
Log:
* mpulsweb/controllers/case_bundle.py
(CaseBundleController._build_casebundle): Simplify by using the
new all_ids form parameter


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-09-14 19:14:07 UTC (rev 3635)
+++ base/trunk/ChangeLog	2010-09-14 19:15:06 UTC (rev 3636)
@@ -1,5 +1,11 @@
 2010-09-14  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/controllers/case_bundle.py
+	(CaseBundleController._build_casebundle): Simplify by using the
+	new all_ids form parameter
+
+2010-09-14  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/templates/casemanagement/overview.mako: Add hidden
 	parameter all_ids for the list of ids of all the cases in the
 	search result.  This will avoid having to do an extra search when

Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py	2010-09-14 19:14:07 UTC (rev 3635)
+++ base/trunk/mpulsweb/controllers/case_bundle.py	2010-09-14 19:15:06 UTC (rev 3636)
@@ -207,19 +207,11 @@
         return list
 
     def _build_casebundle(self, options):
-        user = session['USER_AUTHORIZED']
         if options.get('all_cases') > 0:
-            # Narf! Load ids of all cases with the last search
-            # option again as they are not included in the submitted
-            # data.
-            search_options = search_options_from_session()
-            search = parseSearchOptions(search_options,
-                                        extended=session.get("EXTENDED_SEARCH"))
-            case_bundle = MpulsCaseBundle([case.id for case in
-                                           MpulsCaseOverview().search(search)])
+            ids = options["all_ids"]
         else:
-            case_bundle = MpulsCaseBundle(options.get('case_id'))
-        return case_bundle
+            ids = options.get("case_id")
+        return MpulsCaseBundle(ids)
 
     def _empty_caselist(self):
         c.url_ok = url_for(controller='/case_overview')



More information about the Mpuls-commits mailing list