mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-20 15:51:36 +02:00
initial commit
This commit is contained in:
44
app/apps/users/forms.py
Normal file
44
app/apps/users/forms.py
Normal file
@@ -0,0 +1,44 @@
|
||||
from crispy_forms.bootstrap import (
|
||||
FormActions,
|
||||
PrependedText,
|
||||
Alert,
|
||||
)
|
||||
from crispy_forms.helper import FormHelper
|
||||
from crispy_forms.layout import Layout, Submit, Div, HTML
|
||||
from django import forms
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.forms import (
|
||||
# AuthenticationForm,
|
||||
UsernameField,
|
||||
PasswordResetForm,
|
||||
SetPasswordForm,
|
||||
PasswordChangeForm,
|
||||
UserCreationForm,
|
||||
)
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django_recaptcha.fields import ReCaptchaField
|
||||
from django_recaptcha.widgets import ReCaptchaV3
|
||||
from unfold.forms import AuthenticationForm
|
||||
|
||||
|
||||
class LoginForm(AuthenticationForm):
|
||||
username = UsernameField(
|
||||
label="Seu e-mail",
|
||||
widget=forms.TextInput(
|
||||
attrs={"class": "form-control", "placeholder": "E-mail"}
|
||||
),
|
||||
)
|
||||
password = forms.CharField(
|
||||
label="Sua senha",
|
||||
strip=False,
|
||||
widget=forms.PasswordInput(
|
||||
attrs={"class": "form-control", "placeholder": "Senha"}
|
||||
),
|
||||
)
|
||||
|
||||
error_messages = {
|
||||
"invalid_login": _("E-mail ou senha inválidos."),
|
||||
"inactive": _("Esta conta esta desativada."),
|
||||
}
|
||||
Reference in New Issue
Block a user