Commit b2933aab authored by Luuk Scholten's avatar Luuk Scholten

Merge branch 'fix/login-username-missing' into 'master'

Make sure username is present in form submit

See merge request !403
parent 55d2b4e3
......@@ -40,7 +40,9 @@ class UserCreationForm(BaseUserCreationForm):
initial=True)
def clean(self):
self.cleaned_data['username'] = self.cleaned_data['username'].lower()
if 'username' in self.cleaned_data:
self.cleaned_data['username'] = (self.cleaned_data['username']
.lower())
super().clean()
def save(self, commit=True):
......@@ -80,5 +82,7 @@ class UserChangeForm(BaseUserChangeForm):
super().__init__(*args, **kwargs)
def clean(self):
self.cleaned_data['username'] = self.cleaned_data['username'].lower()
if 'username' in self.cleaned_data:
self.cleaned_data['username'] = (self.cleaned_data['username']
.lower())
super().clean()
......@@ -7,5 +7,7 @@ class AuthenticationForm(BaseAuthenticationForm):
super(AuthenticationForm, self).__init__(request, *args, **kwargs)
def clean(self):
self.cleaned_data['username'] = self.cleaned_data['username'].lower()
if 'username' in self.cleaned_data:
self.cleaned_data['username'] = (self.cleaned_data['username']
.lower())
super().clean()
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