# HG changeset patch # User Brian Neal # Date 1400030610 18000 # Node ID 004b3a90de66e277d610a6bd9f5a5a3f00cd0497 # Parent 9133b4626a4bde4d833009da38a258cfd4a5cebd Update our code that expected LOGIN_REDIRECT_URL to be a url. It is now a view name. diff -r 9133b4626a4b -r 004b3a90de66 accounts/views.py --- a/accounts/views.py Tue May 13 19:44:48 2014 -0500 +++ b/accounts/views.py Tue May 13 20:23:30 2014 -0500 @@ -4,9 +4,7 @@ """ import logging -from django.shortcuts import render -from django.http import HttpResponseRedirect -from django.core.urlresolvers import reverse +from django.shortcuts import render, redirect from django.conf import settings from accounts.models import PendingUser @@ -22,13 +20,13 @@ @log_auth_failures('Register') def register(request): if request.user.is_authenticated(): - return HttpResponseRedirect(settings.LOGIN_REDIRECT_URL) + return redirect(settings.LOGIN_REDIRECT_URL) if request.method == 'POST': form = RegisterForm(request.POST, ip=request.META.get('REMOTE_ADDR', '?')) if form.is_valid(): form.save() - return HttpResponseRedirect(reverse('accounts.views.register_thanks')) + return redirect('accounts.views.register_thanks') else: form = RegisterForm() @@ -38,7 +36,7 @@ def register_thanks(request): if request.user.is_authenticated(): - return HttpResponseRedirect(settings.LOGIN_REDIRECT_URL) + return redirect(settings.LOGIN_REDIRECT_URL) return render(request, 'accounts/register_thanks.html') @@ -46,7 +44,7 @@ def register_confirm(request, username, key): if request.user.is_authenticated(): - return HttpResponseRedirect(settings.LOGIN_REDIRECT_URL) + return redirect(settings.LOGIN_REDIRECT_URL) # purge expired users @@ -78,13 +76,13 @@ def username_query(request): """This view handles forgotten username queries.""" if request.user.is_authenticated(): - return HttpResponseRedirect(settings.LOGIN_REDIRECT_URL) + return redirect(settings.LOGIN_REDIRECT_URL) if request.method == 'POST': form = ForgotUsernameForm(data=request.POST) if form.is_valid(): form.save() - return HttpResponseRedirect(reverse('accounts-username_sent')) + return redirect('accounts-username_sent') else: form = ForgotUsernameForm()