3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-25 22:22:27 +00:00
coope/coopeV3/views.py

12 lines
398 B
Python
Raw Normal View History

from django.shortcuts import redirect
from django.urls import reverse
def home(request):
2018-10-05 22:03:02 +00:00
if request.user.is_authenticated:
if(request.user.has_perm('gestion.can_manage')):
return redirect(reverse('gestion:manage'))
else:
return redirect(reverse('users:profile', kwargs={'pk': request.user.pk}))
else:
return redirect(reverse('users:login'))