Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5 from AndreLouisCaron/master

Use LOGIN_REDIRECT_URL setting in login view.
  • Loading branch information...
commit 4e93df0a5874a3d52231b60e5e4ee9abf66eb19d 2 parents c677197 + 4136016
@mstepniowski mstepniowski authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 cas_provider/views.py
View
7 cas_provider/views.py
@@ -3,6 +3,7 @@
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
@@ -10,7 +11,11 @@
__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:
Please sign in to comment.
Something went wrong with that request. Please try again.