# HG changeset patch # User Lennard de Rijk # Date 1228248854 0 # Node ID 33b6dcae561553f784b4063c037d673a0cd75e4a # Parent 95a41542e6936204251cf0f2897b24dd45bdd6c8 Changed clean_link_id to convert the input to lower characters for user comfort. It has been changed in a couple of files, most importantly in logic/cleaning.py wich will be used by future forms to do their cleaning. Patch by: Lennard de Rijk diff -r 95a41542e693 -r 33b6dcae5615 app/soc/logic/cleaning.py --- a/app/soc/logic/cleaning.py Tue Dec 02 20:10:23 2008 +0000 +++ b/app/soc/logic/cleaning.py Tue Dec 02 20:14:14 2008 +0000 @@ -37,7 +37,8 @@ """ def wrapped(self): - link_id = self.cleaned_data.get('link_id') + # convert to lowercase for user comfort + link_id = self.cleaned_data.get('link_id').lower() if not validate.isLinkIdFormatValid(link_id): raise forms.ValidationError("This link ID is in wrong format.") if logic.getFromFields(link_id=link_id): @@ -48,7 +49,8 @@ def clean_link_id(self): - link_id = self.cleaned_data.get('link_id') + # convert to lowercase for user comfort + link_id = self.cleaned_data.get('link_id').lower() if not validate.isLinkIdFormatValid(link_id): raise forms.ValidationError("This link ID is in wrong format.") return link_id diff -r 95a41542e693 -r 33b6dcae5615 app/soc/views/models/document.py --- a/app/soc/views/models/document.py Tue Dec 02 20:10:23 2008 +0000 +++ b/app/soc/views/models/document.py Tue Dec 02 20:14:14 2008 +0000 @@ -63,7 +63,7 @@ return scope_path def clean_link_id(self): - link_id = self.cleaned_data.get('link_id') + link_id = self.cleaned_data.get('link_id').lower() # TODO(tlarsen): combine path and link_id and check for uniqueness if not validate.isLinkIdFormatValid(link_id): raise forms.ValidationError("This link ID is in wrong format.") diff -r 95a41542e693 -r 33b6dcae5615 app/soc/views/models/user.py --- a/app/soc/views/models/user.py Tue Dec 02 20:10:23 2008 +0000 +++ b/app/soc/views/models/user.py Tue Dec 02 20:14:14 2008 +0000 @@ -65,7 +65,7 @@ model = None def clean_link_id(self): - link_id = self.cleaned_data.get('link_id') + link_id = self.cleaned_data.get('link_id').lower() if not validate.isLinkIdFormatValid(link_id): raise forms.ValidationError("This link ID is in wrong format.") diff -r 95a41542e693 -r 33b6dcae5615 app/soc/views/models/user_self.py --- a/app/soc/views/models/user_self.py Tue Dec 02 20:10:23 2008 +0000 +++ b/app/soc/views/models/user_self.py Tue Dec 02 20:14:14 2008 +0000 @@ -55,7 +55,7 @@ exclude = ['account', 'former_accounts', 'is_developer'] def clean_link_id(self): - link_id = self.cleaned_data.get('link_id') + link_id = self.cleaned_data.get('link_id').lower() if not validate.isLinkIdFormatValid(link_id): raise forms.ValidationError("This link ID is in wrong format.")