Commit e4fe56f664901be40a15e369134258114f9b9a64

Authored by Carlos Coêlho
Committed by Sergio Oliveira
1 parent e80461ab

Corrected empty checking for user and username

Signed-off-by: Carlos Oliveira <carlospecter@gmail.com>
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
colab/accounts/auth.py
... ... @@ -14,7 +14,7 @@ class ColabBrowserIDBackend(BrowserIDBackend):
14 14  
15 15 user = self.User.objects.filter(emails__address=email)
16 16  
17   - if len(user) is not 0:
  17 + if not user:
18 18 return user
19 19  
20 20 return self.User.objects.create_user(
... ...
colab/accounts/forms.py
... ... @@ -58,7 +58,7 @@ class UserCreationForm(UserForm):
58 58 def clean_username(self):
59 59 username = self.cleaned_data['username']
60 60 username = username.strip()
61   - if len(username) is 0:
  61 + if not username:
62 62 raise forms.ValidationError('This field should not be blank.')
63 63 return username
64 64  
... ...