# HG changeset patch # User Sverre Rabbelier # Date 1235073384 0 # Node ID 08dbb5aa1dc9e53bb5c44563ea9c3242b255f38b # Parent fe00de66f4e664067e04c661840b8418588891cc Add a regular 'empty field cleaner' Regular, as opposed to a decorator. Patch by: Sverre Rabbelier diff -r fe00de66f4e6 -r 08dbb5aa1dc9 app/soc/logic/cleaning.py --- 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. """