From 47ffb622b62d601d12dab5f86a10acd6bf70cabe Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Mon, 20 Aug 2012 16:25:50 +0200 Subject: [PATCH] Fix redirection in logging form The redirection was being ignored because the template in horizon needs the a value for redirect_field_name. We simply set it to the default. --- openstack_auth/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openstack_auth/views.py b/openstack_auth/views.py index fd515805..3b2494ad 100644 --- a/openstack_auth/views.py +++ b/openstack_auth/views.py @@ -2,6 +2,7 @@ import logging from django import shortcuts from django.conf import settings +from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.views import (login as django_login, logout_then_login as django_logout) from django.contrib.auth.decorators import login_required @@ -37,12 +38,13 @@ def login(request): else: form = curry(Login, initial=initial) + extra_context = {'redirect_field_name': REDIRECT_FIELD_NAME} + if request.is_ajax(): template_name = 'auth/_login.html' - extra_context = {'hide': True} + extra_context['hide'] = True else: template_name = 'auth/login.html' - extra_context = {} res = django_login(request, template_name=template_name,