Add a regular 'empty field cleaner'
Regular, as opposed to a decorator.
Patch by: Sverre Rabbelier
--- a/app/soc/logic/cleaning.py Thu Feb 19 18:37:44 2009 +0000
+++ b/app/soc/logic/cleaning.py Thu Feb 19 19:56:24 2009 +0000
@@ -70,6 +70,17 @@
return decorator
+def clean_empty_field(field_name):
+ """Incorperates the check_field_is_empty as regular cleaner.
+ """
+
+ @check_field_is_empty(field_name)
+ def wrapper(self):
+ return self.cleaned_data.get(field_name)
+
+ return wrapper
+
+
def clean_link_id(field_name):
"""Checks if the field_name value is in a valid link ID format.
"""