mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Prevent moderators and admins from being deleted
This commit is contained in:
parent
e709fc9ce3
commit
12bcdf2d47
@ -214,6 +214,10 @@ def delete(username):
|
||||
if not user:
|
||||
abort(404)
|
||||
|
||||
if user.rank.atLeast(UserRank.MODERATOR):
|
||||
flash("Users with moderator rank or above cannot be deleted", "danger")
|
||||
return redirect(url_for("users.account", username=username))
|
||||
|
||||
if request.method == "GET":
|
||||
return render_template("users/delete.html", user=user, can_delete=user.can_delete())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user