From 4dfb0610debb746e2128c19aed389950e9c5349c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 18 Jan 2022 00:24:04 +0200 Subject: [PATCH] xvc --- files/routes/admin.py | 12 ++++-------- files/templates/submission.html | 8 +++----- files/templates/submission_listing.html | 8 +++----- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index b0d2bf068..9da25176d 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1024,16 +1024,12 @@ def api_distinguish_post(post_id, v): post = g.db.query(Submission).filter_by(id=post_id).one_or_none() - if not post: - abort(404) + if not post: abort(404) - if not post.author_id == v.id: - abort(403) + if post.author_id != v.id and v.admin_level < 2 : abort(403) - if post.distinguish_level: - post.distinguish_level = 0 - else: - post.distinguish_level = v.admin_level + if post.distinguish_level: post.distinguish_level = 0 + else: post.distinguish_level = v.admin_level g.db.add(post) diff --git a/files/templates/submission.html b/files/templates/submission.html index 774e4344e..f607afe24 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -318,10 +318,8 @@ - {% if v.id == p.author_id %} - - - {% endif %} + + @@ -614,7 +612,7 @@ {% endif %} {% if v %} - {% if v.admin_level and v == p.author %} + {% if v.admin_level %} Distinguish Undistinguish {% endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 9a9e1a403..ef1e2b5f1 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -252,7 +252,7 @@ {% if v %}