3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-05 01:16:28 +00:00

connexion redirection

This commit is contained in:
Yoann Pétri 2019-06-10 01:40:08 +02:00
parent feec35b0b2
commit 666be3f9bd

View file

@ -35,10 +35,7 @@ def loginView(request):
if user is not None:
login(request, user)
messages.success(request, "Vous êtes à présent connecté sous le compte " + str(user))
if(request.user.has_perm('gestion.can_manage')):
return redirect(reverse('gestion:manage'))
else:
return redirect(reverse('users:profile', kwargs={'pk':request.user.pk}))
return redirect(reverse('home'))
else:
messages.error(request, "Nom d'utilisateur et/ou mot de passe invalide")
return render(request, "form.html", {"form_entete": "Connexion", "form": form, "form_title": "Connexion", "form_button": "Se connecter", "form_button_icon": "sign-in-alt"})