Returning None instead of the empty to fix a bug on melange-demo instance.
authorLennard de Rijk <ljvderijk@gmail.com>
Thu, 12 Feb 2009 23:06:14 +0000
changeset 1288 4ef7de6c2b7a
parent 1287 9b18d612510a
child 1289 86a4e0e75ea6
Returning None instead of the empty to fix a bug on melange-demo instance. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/logic/cleaning.py
--- a/app/soc/logic/cleaning.py	Thu Feb 12 22:52:16 2009 +0000
+++ b/app/soc/logic/cleaning.py	Thu Feb 12 23:06:14 2009 +0000
@@ -56,7 +56,7 @@
 
       if not field_content:
         # field has no content so bail out
-        return field_content
+        return None
       else:
         # field has contents
         return fun(self)
@@ -236,10 +236,6 @@
 
     value = self.cleaned_data.get(field_name)
 
-    # LinkProperty does not accept the empty string so we must return None
-    if not value or value == u'':
-      return None
-
     # call the Django URLField cleaning method to properly clean/validate this field
     return forms.URLField.clean(self.fields[field_name], value)
   return wrapped