Permalink
Browse files

Merge pull request #5 from AndreLouisCaron/master

Use LOGIN_REDIRECT_URL setting in login view.
  • Loading branch information...
2 parents c677197 + 4136016 commit 4e93df0a5874a3d52231b60e5e4ee9abf66eb19d @mstepniowski mstepniowski committed Nov 26, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 cas_provider/views.py
View
@@ -3,14 +3,19 @@
from django.template import RequestContext
from django.contrib.auth import authenticate
from django.contrib.auth import login as auth_login, logout as auth_logout
+from django.conf import settings
from forms import LoginForm
from models import ServiceTicket, LoginTicket
from utils import create_service_ticket
__all__ = ['login', 'validate', 'logout']
-def login(request, template_name='cas/login.html', success_redirect='/accounts/'):
+def login(request, template_name='cas/login.html', success_redirect=None ):
+ if not success_redirect:
+ success_redirect = settings.get('LOGIN_REDIRECT_URL', None)
+ if not success_redirect:
+ success_redirect = '/accounts/profile/'
service = request.GET.get('service', None)
if request.user.is_authenticated():
if service is not None:

0 comments on commit 4e93df0

Please sign in to comment.