diff options
author | lin-hua-cheng <os.lcheng@gmail.com> | 2015-04-13 10:35:29 -0700 |
---|---|---|
committer | lin-hua-cheng <os.lcheng@gmail.com> | 2015-04-13 12:40:43 -0700 |
commit | f3a2c4aa16e3a56d1af22a10a619f68f19207b43 (patch) | |
tree | 4ad8bffdfd331597379a486caed6219923e27cbb | |
parent | fc755dc5512e71b5e6a9a36782fa319d02e7f5d3 (diff) | |
download | django_openstack_auth-f3a2c4aa16e3a56d1af22a10a619f68f19207b43.tar.gz |
Fix test error for Django1.7
Change-Id: Id233e73173818d0fa69621fc26d824e1bd8b5472
-rw-r--r-- | openstack_auth/forms.py | 6 |
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): |