Skip to content

Commit

Permalink
fix the loop when non-admin user visits an admin URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Son NK committed May 7, 2024
1 parent b82b28d commit 89bc36f
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 89bc36f

Please sign in to comment.