]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
settings: Remove hard coded login url value
authorMichael Wood <michael.g.wood@intel.com>
Thu, 12 Nov 2015 18:30:36 +0000 (18:30 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Fri, 8 Apr 2016 13:56:48 +0000 (14:56 +0100)
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 <michael.g.wood@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
patchwork/settings/base.py
patchwork/tests/test_user.py

index 26236d73eaa4128251cf8d627fbdf7275679b3db..2f81d4b172769f3ea7e8c7b470f4375d7a6800bf 100644 (file)
@@ -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'
 
 
 #
index 1a42659b47eb718ce729918fba0a749f791c5eb6..53482a8193948c53ebb88c0bdb026806585a264c 100644 (file)
@@ -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):