diff roundup/cgi/client.py @ 1380:4ce6820c18fa

fixes to CGI form handling (NEEDS BACKPORTING TO 0.5)
author Richard Jones <richard@users.sourceforge.net>
date Tue, 14 Jan 2003 22:21:35 +0000
parents 3931614b1cce
children 944bd3c6d365
line wrap: on
line diff
--- a/roundup/cgi/client.py	Tue Jan 14 22:19:27 2003 +0000
+++ b/roundup/cgi/client.py	Tue Jan 14 22:21:35 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.67 2003-01-13 22:14:00 kedder Exp $
+# $Id: client.py,v 1.68 2003-01-14 22:21:35 richard Exp $
 
 __doc__ = """
 WWW request handler (also used in the stand-alone server).
@@ -1252,8 +1252,6 @@
             value = value.value.strip()
 
         if isinstance(proptype, hyperdb.String):
-            if not value:
-                continue
             # fix the CRLF/CR -> LF stuff
             value = fixNewlines(value)
         elif isinstance(proptype, hyperdb.Password):
@@ -1369,10 +1367,17 @@
                 if not properties.has_key(propname):
                     raise
 
+            # existing may be None, which won't equate to empty strings
+            if not existing and not value:
+                continue
+
             # if changed, set it
             if value != existing:
                 props[propname] = value
         else:
+            # don't bother setting empty/unset values
+            if not value:
+                continue
             props[propname] = value
 
     # see if all the required properties have been supplied

Roundup Issue Tracker: http://roundup-tracker.org/