generated from ieeeuoft/hackathon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.py
32 lines (24 loc) · 970 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from django.contrib.auth.forms import (
PasswordChangeForm as _PasswordChangeForm,
PasswordResetForm as _PasswordResetForm,
SetPasswordForm as _SetPasswordForm,
AuthenticationForm as _AuthenticationForm,
)
class PasswordChangeForm(_PasswordChangeForm):
def __init__(self, user, *args, **kwargs):
super().__init__(user, *args, **kwargs)
self.error_css_class = "invalid"
self.label_suffix = ""
class PasswordResetForm(_PasswordResetForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.error_css_class = "invalid"
self.label_suffix = ""
class SetPasswordForm(_SetPasswordForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.error_css_class = "invalid"
self.label_suffix = ""
class AuthenticationForm(_AuthenticationForm):
def clean_username(self):
return self.cleaned_data["username"].lower()