[Mpuls-commits] r3409 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Aug 13 20:23:14 CEST 2010


Author: bh
Date: 2010-08-13 20:23:13 +0200 (Fri, 13 Aug 2010)
New Revision: 3409

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/search.py
Log:
* mpulsweb/lib/search.py (CaseSearch.get_editor_clause): Refactor
to make the logic clearer


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-08-13 18:03:08 UTC (rev 3408)
+++ base/trunk/ChangeLog	2010-08-13 18:23:13 UTC (rev 3409)
@@ -1,5 +1,10 @@
 2010-08-13  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/search.py (CaseSearch.get_editor_clause): Refactor
+	to make the logic clearer
+
+2010-08-13  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/search.py (CaseSearch.get_allowed_viewer_clause):
 	Clarify the logic a little, especially make it clearer what
 	happens when the current user is an admin

Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py	2010-08-13 18:03:08 UTC (rev 3408)
+++ base/trunk/mpulsweb/lib/search.py	2010-08-13 18:23:13 UTC (rev 3409)
@@ -155,9 +155,9 @@
 
         Derived classes may override this method if necessary.
         """
-        editor = (options.has_key('editor')
-                  and "m.bearbeiter_id = %s" % options.get('editor') or "TRUE")
-        return editor
+        if options.has_key('editor'):
+            return "m.bearbeiter_id = %s" % options['editor']
+        return "TRUE"
 
     def get_phases_clause(self, options, phaseslist):
         """Return the search condition to select cases based on their phase.



More information about the Mpuls-commits mailing list