3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-22 11:23:11 +00:00
coope/coopeV3/views.py
2018-10-06 00:03:02 +02:00

11 lines
398 B
Python

from django.shortcuts import redirect
from django.urls import reverse
def home(request):
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'))