Fix admin loop (#2103)
* mailbox page requires sudo * fix the loop when non-admin user visits an admin URL https://github.com/simple-login/app/issues/2101 --------- Co-authored-by: Son NK <son@simplelogin.io>
This commit is contained in:
parent
8f12fabd81
commit
b5b167479f
|
@ -46,7 +46,8 @@ class SLModelView(sqla.ModelView):
|
|||
|
||||
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 = {}
|
||||
|
|
Loading…
Reference in New Issue