From b49d39a68503124804e3300e8b12a84fe2af153b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 15 Jun 2020 18:38:09 +0200 Subject: [PATCH] stages/identification: improve support for password managers --- passbook/stages/identification/forms.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/passbook/stages/identification/forms.py b/passbook/stages/identification/forms.py index 224e06e91..e99292640 100644 --- a/passbook/stages/identification/forms.py +++ b/passbook/stages/identification/forms.py @@ -39,8 +39,16 @@ class IdentificationForm(forms.Form): super().__init__(*args, **kwargs) if self.stage.user_fields == [UserFields.E_MAIL]: self.fields["uid_field"] = forms.EmailField() - self.fields["uid_field"].label = human_list( - [x.title() for x in self.stage.user_fields] + label = human_list([x.title() for x in self.stage.user_fields]) + self.fields["uid_field"].label = label + self.fields["uid_field"].widget.attrs.update( + { + "placeholder": _(label), + "autofocus": "autofocus", + # Autocomplete according to + # https://www.chromium.org/developers/design-documents/form-styles-that-chromium-understands + "autocomplete": "username", + } ) def clean_uid_field(self):