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:
parent
6a44a32ecd
commit
919484683e
1 changed files with 9 additions and 4 deletions
13
re2o/acl.py
13
re2o/acl.py
|
@ -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."))
|
||||||
return redirect(reverse(
|
if request.user.id is not None:
|
||||||
'users:profil',
|
return redirect(reverse(
|
||||||
kwargs={'userid': str(request.user.id)}
|
'users:profil',
|
||||||
))
|
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
|
||||||
|
|
Loading…
Reference in a new issue