From 5ec8e44020abafc502d160a8bcf0f616c36f8087 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 12 Nov 2015 18:30:36 +0000 Subject: [PATCH] settings: Remove hard coded login url value Use the url name for the login page rather than a hard coded value this means that if you have patchwork in a prefix it will redirect to the correct location without any additional configuration. Signed-off-by: Michael Wood Signed-off-by: Stephen Finucane --- patchwork/settings/base.py | 4 ++-- patchwork/tests/test_user.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index 26236d73..2f81d4b1 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -110,8 +110,8 @@ SERVER_EMAIL = DEFAULT_FROM_EMAIL # https://docs.djangoproject.com/en/1.6/ref/settings/#auth # -LOGIN_URL = '/user/login/' -LOGIN_REDIRECT_URL = '/user/' +LOGIN_URL = 'auth_login' +LOGIN_REDIRECT_URL = 'user-profile' # diff --git a/patchwork/tests/test_user.py b/patchwork/tests/test_user.py index 1a42659b..53482a81 100644 --- a/patchwork/tests/test_user.py +++ b/patchwork/tests/test_user.py @@ -17,7 +17,6 @@ # along with Patchwork; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from django.conf import settings from django.contrib.auth.models import User from django.core import mail from django.core.urlresolvers import reverse @@ -132,7 +131,7 @@ class UserLoginRedirectTest(TestCase): def testUserLoginRedirect(self): url = '/user/' response = self.client.get(url) - self.assertRedirects(response, settings.LOGIN_URL + '?next=' + url) + self.assertRedirects(response, reverse('auth_login') + '?next=' + url) class UserProfileTest(TestCase): -- 2.47.3