Skip to content

Commit

Permalink
Un pseudo ne peut plus commencer/finir avec espace
Browse files Browse the repository at this point in the history
  • Loading branch information
Eskimon committed Jul 27, 2014
1 parent c0674d9 commit d705c34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zds/member/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,9 @@ def clean(self):
username_new = cleaned_data.get('username_new')
email_new = cleaned_data.get('email_new')

username = username_new.strip()
if username_new is not None:
if username_new.strip() != '':
if username_new != '':
if User.objects.filter(username=username_new).count() >= 1:
self._errors['username_new'] = self.error_class(
[u'Ce nom d\'utilisateur est déjà utilisé'])
Expand Down

0 comments on commit d705c34

Please sign in to comment.