First of all, i want to thanks all the responsible for this great project, it was very helpful to me and to make it more so, allow me to make my contribution, hopefully it will be helpful to someone other than me.
When a logged in user with no admin credentials try to access a URL which require admin credential, the user will be trapped in an infinite loop of redirects.
The new code is simple, basically it only redirect not logged in users to the login URL:
if not users.is_current_user_admin():
return func(*args, **kwargs)
One drawback of this new code, is that in development environment, if you are already logged in with no admin user and you try to access an admin page you will have to logged out before you can try again.
BUGFIX: Fix ``admin_required`` decorator to not redirect connected us…
no admin credentials in infinite loop.