3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-12-24 16:03:47 +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: if user is not None:
login(request, user) login(request, user)
messages.success(request, "Vous êtes à présent connecté sous le compte " + str(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('home'))
return redirect(reverse('gestion:manage'))
else:
return redirect(reverse('users:profile', kwargs={'pk':request.user.pk}))
else: else:
messages.error(request, "Nom d'utilisateur et/ou mot de passe invalide") 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"}) return render(request, "form.html", {"form_entete": "Connexion", "form": form, "form_title": "Connexion", "form_button": "Se connecter", "form_button_icon": "sign-in-alt"})