diff options
Diffstat (limited to 'users/forms.py')
| -rw-r--r-- | users/forms.py | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/users/forms.py b/users/forms.py index 016ad6bb..fbb5e244 100644 --- a/users/forms.py +++ b/users/forms.py @@ -16,15 +16,40 @@ from .mail_send import send_email class RegisterForm(forms.Form): - username = forms.CharField(label="Username", max_length=30, min_length=4) - email = forms.EmailField(label="Email") + username = forms.CharField( + label="Username", + max_length=30, + min_length=4, + required=True, + widget=forms.TextInput( + attrs={"placeholder": "Username", "autocomplete": "off"} + ), + ) + email = forms.EmailField( + label="Email", + max_length=255, + required=True, + widget=forms.EmailInput(attrs={"placeholder": "Email", "autocomplete": "off"}), + ) password1 = forms.CharField( - label="Password", widget=forms.PasswordInput, min_length=8 + label="Password", + min_length=8, + required=True, + widget=forms.PasswordInput(attrs={"placeholder": "Password"}), ) password2 = forms.CharField( - label="Password (again)", widget=forms.PasswordInput, min_length=8 + label="Password (again)", + widget=forms.PasswordInput(attrs={"placeholder": "Password (again)"}), + min_length=8, + required=True, + ) + captcha = forms.CharField( + label="Captcha", + max_length=6, + min_length=6, + required=True, + widget=forms.TextInput(attrs={"placeholder": "Captcha", "autocomplete": "off"}), ) - captcha = forms.CharField(label="Captcha", max_length=6) expected_captcha = None protected_usernames = [ "admin", @@ -169,6 +194,7 @@ class ForgotPasswordForm(forms.Form): else: raise forms.ValidationError("Failed to send email.") + class ResetPasswordForm(forms.Form): password1 = forms.CharField( label="New Password", widget=forms.PasswordInput, min_length=8 @@ -193,6 +219,7 @@ class ResetPasswordForm(forms.Form): user.save() return user + class UpdateUserDetailsForm(forms.Form): first_name = forms.CharField( label="First name", |
