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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 5 19:11:41 CET 2010


Author: bh
Date: 2010-02-05 19:11:36 +0100 (Fri, 05 Feb 2010)
New Revision: 1292

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/waskaweb/model/case.py
Log:
* waskaweb/model/case.py (Case.getSessionCase): Get the values for
the session case with getattr(self, ...) instead of self.get_value
to make sure some of the values are strings for backwards
compatibility reasons.  Some templates have problems, otherwise.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-05 17:57:40 UTC (rev 1291)
+++ wasko/branches/2.0/ChangeLog	2010-02-05 18:11:36 UTC (rev 1292)
@@ -1,5 +1,12 @@
 2010-02-05  Bernhard Herzog  <bh at intevation.de>
 
+	* waskaweb/model/case.py (Case.getSessionCase): Get the values for
+	the session case with getattr(self, ...) instead of self.get_value
+	to make sure some of the values are strings for backwards
+	compatibility reasons.  Some templates have problems, otherwise.
+
+2010-02-05  Bernhard Herzog  <bh at intevation.de>
+
 	* waskaweb/templates/casemanagement/digest_body.mako: Add a
 	comment for the fields list.
 

Modified: wasko/branches/2.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/case.py	2010-02-05 17:57:40 UTC (rev 1291)
+++ wasko/branches/2.0/waskaweb/model/case.py	2010-02-05 18:11:36 UTC (rev 1292)
@@ -788,7 +788,13 @@
         """Return a SessionCase object initialized from the current case"""
         fields = dict()
         for desc in self.get_session_fields():
-            fields[desc.name] = self.get_value(desc.formedname)
+            # FIXME: Ideally we would use
+            # self.get_value(desc.formedname) to get the value.  We use
+            # getattr instead because this compatibility layer
+            # translates None values into string which some code
+            # (e.g. buildInfofield in
+            # templates/casemanagement/main.mako) relies on.
+            fields[desc.name] = getattr(self, desc.name)
         signed = self.getPrivacyStatement().isSigned()
         return SessionCase(self.id, state=self.state,
                            privacy_statement=signed,



More information about the Mpuls-commits mailing list