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