[Erp5-report] r24793 - /erp5/trunk/products/ERP5Form/FormulatorPatch.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Dec 4 17:55:13 CET 2008


Author: romain
Date: Thu Dec  4 17:55:10 2008
New Revision: 24793

URL: http://svn.erp5.org?rev=24793&view=rev
Log:
Restore usage of whitespace_preserve attribute, in order to disable strip call
if not wanted.

Modified:
    erp5/trunk/products/ERP5Form/FormulatorPatch.py

Modified: erp5/trunk/products/ERP5Form/FormulatorPatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/FormulatorPatch.py?rev=24793&r1=24792&r2=24793&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/FormulatorPatch.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/FormulatorPatch.py [utf8] Thu Dec  4 17:55:10 2008
@@ -450,7 +450,12 @@
     else:
       raise KeyError, 'Field %s is not present in request object.' % (repr(field.id), )
   if isinstance(value, str):
-    value = string.strip(value)
+    if field.has_value('whitespace_preserve'):
+      if not field.get_value('whitespace_preserve'):
+        value = string.strip(value)
+    else:
+      # XXX Compatibility: use to prevent KeyError exception from get_value
+      value = string.strip(value)
   if field.get_value('required') and value == "":
       self.raise_error('required_not_found', field)
   #if field.get_value('uppercase'):




More information about the Erp5-report mailing list