Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def loginaction(request):
- #authenticate the user
- username = request.POST.get('username')
- password = request.POST.get('password')
- user = authenticate(request,username=username, password=password)
- #if user exists then check the user type:
- if user is not None:
- #get id so that the user_type of the user can be retrieved
- login(request,user)
- # based on the user_type redirect to artist or listener home
- if request.user.appuser.user_type == 'ARTIST' :
- return redirect('/artisthome/') # artist home
- else:
- return redirect('/home/') # lister home
- else:
- return redirect('/login1/')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement