mirror of
https://github.com/nanoy42/coope
synced 2024-08-19 00:13:39 +00:00
connexion redirection
This commit is contained in:
parent
feec35b0b2
commit
666be3f9bd
1 changed files with 1 additions and 4 deletions
|
@ -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"})
|
||||||
|
|
Loading…
Reference in a new issue