Message ID | 1460122753-31306-1-git-send-email-stephen.finucane@intel.com |
---|---|
State | Accepted |
Headers | show |
On 08 Apr 14:39, Stephen Finucane wrote: > From: Michael Wood <michael.g.wood@intel.com> > > 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> Merged.
diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index 26236d7..2f81d4b 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 1a42659..53482a8 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):