From ba3996159e41137f62dc0547ff5b8c9ca92b2349 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 10 Dec 2021 06:00:52 +0200 Subject: [PATCH] fsdfds --- files/routes/settings.py | 2 ++ files/templates/comments.html | 4 ++-- files/templates/submission.html | 4 ++-- files/templates/submission_listing.html | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/files/routes/settings.py b/files/routes/settings.py index 0d01fbfe84..94face50c0 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -851,6 +851,8 @@ def settings_profilecss(v): @validate_formkey def settings_block_user(v): + if v and v.admin_level: return {"error": "Admins can't block users."}, 403 + user = get_user(request.values.get("username"), graceful=True) if not user: return {"error": "That user doesn't exist."}, 404 diff --git a/files/templates/comments.html b/files/templates/comments.html index c02649c828..cb0907200f 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -373,7 +373,7 @@ Distinguish {% endif %} - {% if v and not v.id==c.author_id%} + {% if v and not v.id==c.author_id and not v.admin_level %} Unblock user Are you sure? @@ -562,7 +562,7 @@ API App {% endif %} - {% if not v.id==c.author_id %} + {% if not v.id==c.author_id and not v.admin_level %} Unblock user Are you sure? diff --git a/files/templates/submission.html b/files/templates/submission.html index db3ce37219..7cdfe9230b 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -293,7 +293,7 @@ {% endif %} - {% if v and v.id != p.author_id %} + {% if v and v.id != p.author_id and not v.admin_level %} @@ -611,7 +611,7 @@ API App {% endif %} - {% if not v.id==p.author_id %} + {% if not v.id==p.author_id and not v.admin_level %} Unblock user Are you sure? diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index b9688933c4..76a3368e3c 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -274,7 +274,7 @@ API App {% endif %} - {% if not v.id==p.author_id %} + {% if not v.id==p.author_id and not v.admin_level %} Unblock user Are you sure? @@ -438,7 +438,7 @@ {% endif %} - {% if v and v.id != p.author_id %} + {% if v and v.id != p.author_id and not v.admin_level %}