[Mpuls-commits] r1180 - in wasko/branches/2.0: . waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 2 19:17:00 CET 2010


Author: bh
Date: 2010-02-02 19:16:58 +0100 (Tue, 02 Feb 2010)
New Revision: 1180

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/waskaweb/model/case.py
Log:
* waskaweb/model/case.py (CaseFactory._build_preset): Only add
those fields to the preset dict that are actually present in the
query result.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-02 17:19:29 UTC (rev 1179)
+++ wasko/branches/2.0/ChangeLog	2010-02-02 18:16:58 UTC (rev 1180)
@@ -1,5 +1,11 @@
 2010-02-02  Bernhard Herzog  <bh at intevation.de>
 
+	* waskaweb/model/case.py (CaseFactory._build_preset): Only add
+	those fields to the preset dict that are actually present in the
+	query result.
+
+2010-02-02  Bernhard Herzog  <bh at intevation.de>
+
 	* waskaweb/model/case.py (CaseDigest, CaseField, CaseStringField)
 	(CaseAgeField): Removed.  No longer used.
 

Modified: wasko/branches/2.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/case.py	2010-02-02 17:19:29 UTC (rev 1179)
+++ wasko/branches/2.0/waskaweb/model/case.py	2010-02-02 18:16:58 UTC (rev 1180)
@@ -369,8 +369,8 @@
     existing cases from db or create new cases"""
 
     def _build_preset(self, result):
-        return dict((name, result.get(name))
-                    for name in Case.get_preset_fields())
+        return dict((name, result[name])
+                    for name in Case.get_preset_fields() if name in result)
 
     def loadById(self, id):
         """Load a case with the given id. Return a case object"""



More information about the Mpuls-commits mailing list