8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

Correction de redirection

This commit is contained in:
grisel-davy 2018-06-01 19:12:45 +02:00
parent 1ca1b28a36
commit 5685e9e69c

View file

@ -156,10 +156,13 @@ ModelC)
for msg in error_messages:
messages.error(
request, msg or "Vous ne pouvez pas accéder à ce menu")
return redirect(reverse(
'users:profil',
kwargs={'userid': str(request.user.id)}
))
if request.user.is_authenticated:
return redirect(reverse(
'users:profil',
kwargs={'userid': str(request.user.id)}
))
else:
return redirect(reverse('login'))
return view(request, *chain(instances, args), **kwargs)
return wrapper
return decorator