# HG changeset patch # User Sverre Rabbelier # Date 1237733525 0 # Node ID 4ff03ca639fd761fb5d6ccf86f76ce7baf97b516 # Parent eb02fd5427c5d37d7ba26271e69a0b49a47251ee Optionally return link_id in clean_user_is_current Patch by: Sverre Rabbelier diff -r eb02fd5427c5 -r 4ff03ca639fd app/soc/logic/cleaning.py --- a/app/soc/logic/cleaning.py Sun Mar 22 14:51:37 2009 +0000 +++ b/app/soc/logic/cleaning.py Sun Mar 22 14:52:05 2009 +0000 @@ -172,7 +172,7 @@ return wrapped -def clean_user_is_current(field_name): +def clean_user_is_current(field_name, as_user=True): """Check if the field_name value is a valid link_id and resembles the current user. """ @@ -189,7 +189,7 @@ # this user is not the current user raise forms.ValidationError("This user is not you.") - return user_entity + return user_entity if as_user else link_id return wrapped