-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forms and alerts updates and enhancements
* UserCreationForm * ClippingForms
- Loading branch information
1 parent
198cf82
commit 599763e
Showing
3 changed files
with
102 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,16 +17,49 @@ def is_valid_username(username): | |
|
||
|
||
class UserCreationForm(RegistrationFormUniqueEmail): | ||
username = forms.CharField(widget=forms.TextInput(),) | ||
email = forms.EmailField() | ||
password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput) | ||
username = forms.CharField( | ||
widget=forms.TextInput( | ||
attrs={ | ||
'type':'text', | ||
'class':"form-control" | ||
} | ||
), | ||
label=_("Usuário"), | ||
required=True | ||
) | ||
|
||
email = forms.EmailField( | ||
widget=forms.TextInput( | ||
attrs={ | ||
'placeholder': '[email protected]', | ||
'type':'email', | ||
'class':"form-control" | ||
} | ||
), | ||
required=True | ||
) | ||
password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput( | ||
attrs={ | ||
'class':"form-control" | ||
} | ||
)) | ||
password2 = forms.CharField( | ||
label=_("Password confirmation"), | ||
widget=forms.PasswordInput, | ||
widget=forms.PasswordInput( | ||
attrs={ | ||
'class':"form-control" | ||
}), | ||
help_text=_("Enter the same password as above, for verification."), | ||
) | ||
captcha = ReCaptchaField() | ||
subscribe_newsletter = forms.BooleanField(required=False) | ||
subscribe_newsletter = forms.BooleanField(widget=forms.CheckboxInput( | ||
attrs={ | ||
'type':'checkbox', | ||
'class':'form-check-input' | ||
}, | ||
), | ||
required=False | ||
) | ||
|
||
class Meta: | ||
model = get_user_model() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters