Skip to content

Commit

Permalink
Fix admin loop (#2103)
Browse files Browse the repository at this point in the history
* mailbox page requires sudo

* fix the loop when non-admin user visits an admin URL

#2101

---------

Co-authored-by: Son NK <son@simplelogin.io>
  • Loading branch information
nguyenkims and Son NK committed May 10, 2024
1 parent 8f12fab commit b5b1674
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/admin_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def is_accessible(self):

def inaccessible_callback(self, name, **kwargs):
# redirect to login page if user doesn't have access
return redirect(url_for("auth.login", next=request.url))
flash("You don't have access to the admin page", "error")
return redirect(url_for("dashboard.index", next=request.url))

def on_model_change(self, form, model, is_created):
changes = {}
Expand Down

0 comments on commit b5b1674

Please sign in to comment.