From e4fe56f664901be40a15e369134258114f9b9a64 Mon Sep 17 00:00:00 2001 From: Carlos Oliveira Date: Thu, 18 Dec 2014 13:36:48 -0200 Subject: [PATCH] Corrected empty checking for user and username --- colab/accounts/auth.py | 2 +- colab/accounts/forms.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/colab/accounts/auth.py b/colab/accounts/auth.py index 1a63968..9500fbd 100644 --- a/colab/accounts/auth.py +++ b/colab/accounts/auth.py @@ -14,7 +14,7 @@ class ColabBrowserIDBackend(BrowserIDBackend): user = self.User.objects.filter(emails__address=email) - if len(user) is not 0: + if not user: return user return self.User.objects.create_user( diff --git a/colab/accounts/forms.py b/colab/accounts/forms.py index c0d10b3..fcb6a75 100644 --- a/colab/accounts/forms.py +++ b/colab/accounts/forms.py @@ -58,7 +58,7 @@ class UserCreationForm(UserForm): def clean_username(self): username = self.cleaned_data['username'] username = username.strip() - if len(username) is 0: + if not username: raise forms.ValidationError('This field should not be blank.') return username -- libgit2 0.21.2