From bb2a4bb3c4ef3eb7113388a06b9fd4f502db60bc Mon Sep 17 00:00:00 2001 From: Tatiana Ovchinnikova Date: Thu, 25 Feb 2021 15:48:10 -0600 Subject: [PATCH] Move "Domain" field under "User Name" and "Password" Autofocus on the login screen now is on the first field. It's either "User Name" or "Domain" with multidomain support. However it appears to be more convenient to keep the focus on "User Name" whether there is multidomain support or not. Also "Domain" is pre-filled with the last domain used, so often there's no need to change it. This patch moves "Domain" field under "User Name" and "Password" and keeps autofocus always on "User Name". Closes-Bug: #1916958 Change-Id: I590ce3a5cbaa0ebb470228a7114a60ff89467835 (cherry picked from commit b09e5b303c8ba0e967e5178794a39fcee628e4e0) --- openstack_auth/forms.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openstack_auth/forms.py b/openstack_auth/forms.py index e49ff871d7..74feb331ee 100644 --- a/openstack_auth/forms.py +++ b/openstack_auth/forms.py @@ -89,10 +89,8 @@ class Login(django_auth_forms.AuthenticationForm): else: self.fields['domain'] = forms.CharField( initial=last_domain, - label=_("Domain"), - widget=forms.TextInput(attrs={"autofocus": "autofocus"})) - self.fields['username'].widget = forms.widgets.TextInput() - fields_ordering = ['domain', 'username', 'password', 'region'] + label=_("Domain")) + fields_ordering = ['username', 'password', 'domain', 'region'] self.fields['region'].choices = get_region_choices() if len(self.fields['region'].choices) == 1: self.fields['region'].initial = self.fields['region'].choices[0][0]