Created
August 19, 2016 22:13
-
-
Save vitorfs/75c7ef6641999e793a9539936e775481 to your computer and use it in GitHub Desktop.
Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.views import login as auth_login | |
from django.shortcuts import redirect | |
def login(request): | |
if request.user.is_author(): | |
return redirect('/author/') | |
elif request.user.is_reader(): | |
return redirect('/reader/') | |
defaults = { | |
'authentication_form': CustomAuthenticationForm, | |
'template_name': 'core/login.html', | |
} | |
return auth_login(request, **defaults) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment