summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-04-13 22:21:29 +0000
committerGerrit Code Review <review@openstack.org>2015-04-13 22:21:29 +0000
commit58e9fb0a473a56871697324d200f4e55dbc3be58 (patch)
tree4863f28a0f8a0173c6b30f3ed083c53668b576fe
parent97ff7106cbb9791a981616fcecb7f7d2ab9dcc30 (diff)
parentf3a2c4aa16e3a56d1af22a10a619f68f19207b43 (diff)
downloaddjango_openstack_auth-58e9fb0a473a56871697324d200f4e55dbc3be58.tar.gz
Merge "Fix test error for Django1.7"
-rw-r--r--openstack_auth/forms.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/openstack_auth/forms.py b/openstack_auth/forms.py
index be3fdc7..9b03569 100644
--- a/openstack_auth/forms.py
+++ b/openstack_auth/forms.py
@@ -77,12 +77,14 @@ class Login(django_auth_forms.AuthenticationForm):
# prepend the websso_choices select input to the form
if utils.is_websso_enabled():
initial = getattr(settings, 'WEBSSO_INITIAL_CHOICE', 'credentials')
- choicefield = forms.ChoiceField(
+ self.fields['auth_type'] = forms.ChoiceField(
label=_("Authenticate using"),
choices=getattr(settings, 'WEBSSO_CHOICES', ()),
required=False,
initial=initial)
- self.fields.insert(0, 'auth_type', choicefield)
+ # move auth_type to the top of the list
+ self.fields.keyOrder.pop(-1)
+ self.fields.keyOrder.insert(0, 'auth_type')
# websso is enabled, but keystone version is not supported
elif getattr(settings, 'WEBSSO_ENABLED', False):