mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 14:32:25 +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:
|
if not user:
|
||||||
abort(404)
|
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":
|
if request.method == "GET":
|
||||||
return render_template("users/delete.html", user=user, can_delete=user.can_delete())
|
return render_template("users/delete.html", user=user, can_delete=user.can_delete())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user