summaryrefslogtreecommitdiff
path: root/openstack_auth/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack_auth/views.py')
-rw-r--r--openstack_auth/views.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/openstack_auth/views.py b/openstack_auth/views.py
index 9e060a0..eb70940 100644
--- a/openstack_auth/views.py
+++ b/openstack_auth/views.py
@@ -12,7 +12,6 @@
# limitations under the License.
import logging
-import django
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.decorators import login_required # noqa
@@ -83,13 +82,7 @@ def login(request, template_name=None, extra_context=None, **kwargs):
initial.update({'region': requested_region})
if request.method == "POST":
- # NOTE(saschpe): Since https://code.djangoproject.com/ticket/15198,
- # the 'request' object is passed directly to AuthenticationForm in
- # django.contrib.auth.views#login:
- if django.VERSION >= (1, 6):
- form = functional.curry(forms.Login)
- else:
- form = functional.curry(forms.Login, request)
+ form = functional.curry(forms.Login)
else:
form = functional.curry(forms.Login, initial=initial)
@@ -233,7 +226,7 @@ def switch(request, tenant_id, redirect_field_name=auth.REDIRECT_FIELD_NAME):
# Ensure the user-originating redirection url is safe.
# Taken from django.contrib.auth.views.login()
- redirect_to = request.REQUEST.get(redirect_field_name, '')
+ redirect_to = request.GET.get(redirect_field_name, '')
if not is_safe_url(url=redirect_to, host=request.get_host()):
redirect_to = settings.LOGIN_REDIRECT_URL
@@ -270,7 +263,7 @@ def switch_region(request, region_name,
LOG.debug('Switching services region to %s for user "%s".'
% (region_name, request.user.username))
- redirect_to = request.REQUEST.get(redirect_field_name, '')
+ redirect_to = request.GET.get(redirect_field_name, '')
if not is_safe_url(url=redirect_to, host=request.get_host()):
redirect_to = settings.LOGIN_REDIRECT_URL