ui: start patternfly v4 migration
This commit is contained in:
@ -16,18 +16,15 @@ class LoginForm(forms.Form):
|
||||
"""Allow users to login"""
|
||||
|
||||
title = _("Log in to your account")
|
||||
uid_field = forms.CharField()
|
||||
remember_me = forms.BooleanField(required=False)
|
||||
uid_field = forms.CharField(label=_(""))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
if CONFIG.y("passbook.uid_fields") == ["e-mail"]:
|
||||
self.fields["uid_field"] = forms.EmailField()
|
||||
self.fields["uid_field"].widget.attrs = {
|
||||
"placeholder": _(
|
||||
human_list([x.title() for x in CONFIG.y("passbook.uid_fields")])
|
||||
)
|
||||
}
|
||||
self.fields["uid_field"].label = human_list(
|
||||
[x.title() for x in CONFIG.y("passbook.uid_fields")]
|
||||
)
|
||||
|
||||
def clean_uid_field(self):
|
||||
"""Validate uid_field after EmailValidator if 'email' is the only selected uid_fields"""
|
||||
|
Reference in New Issue
Block a user