8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 19:33:11 +00:00

Do not fail on ACL with unauthenticated users.

This commit is contained in:
Hugo Levy-Falk 2019-09-05 19:16:37 +02:00
parent 6a44a32ecd
commit 919484683e

View file

@ -158,10 +158,15 @@ ModelC)
messages.error( messages.error(
request, msg or _("You don't have the right to access" request, msg or _("You don't have the right to access"
" this menu.")) " this menu."))
if request.user.id is not None:
return redirect(reverse( return redirect(reverse(
'users:profil', 'users:profil',
kwargs={'userid': str(request.user.id)} kwargs={'userid': str(request.user.id)}
)) ))
else:
return redirect(reverse(
'index',
))
return view(request, *chain(instances, args), **kwargs) return view(request, *chain(instances, args), **kwargs)
return wrapper return wrapper
return decorator return decorator