Commit d7ad71dc authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Fix LoginForm clean incase of login failure

Bug #2535
parent a4afa188
......@@ -322,7 +322,7 @@ class LoginForm(AuthenticationForm):
def clean(self):
super(LoginForm, self).clean()
if self.user_cache.provider != 'local':
if self.user_cache and self.user_cache.provider not in ('local', ''):
raise forms.ValidationError(_('Local login is not the current authentication method for this account.'))
return self.cleaned_data
......@@ -477,7 +477,6 @@ class ExtendedPasswordChangeForm(PasswordChangeForm):
def __init__(self, user, *args, **kwargs):
super(ExtendedPasswordChangeForm, self).__init__(user, *args, **kwargs)
print self.fields.keyOrder
def save(self, commit=True):
user = super(ExtendedPasswordChangeForm, self).save(commit=False)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment