From 6be7c326b68c702a90cd0f764911ec19630ad419 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 22 Jul 2021 20:52:13 +0200 Subject: [PATCH] sneed --- ruqqus/routes/comments.py | 7 ++++--- ruqqus/routes/posts.py | 6 +++--- ruqqus/templates/comments.html | 4 ++++ ruqqus/templates/submission.html | 4 ++++ ruqqus/templates/submission_listing.html | 4 ++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ruqqus/routes/comments.py b/ruqqus/routes/comments.py index 964285773..ea3f61aa4 100644 --- a/ruqqus/routes/comments.py +++ b/ruqqus/routes/comments.py @@ -21,11 +21,12 @@ beams_client = PushNotifications( secret_key=PUSHER_KEY, ) -@app.route("/banaward/", methods=["POST"]) +@app.route("/banaward/comment/", methods=["POST"]) @auth_required -def banaward(comment_id, v): +def banawardcomment(comment_id, v): - if v.banawards != 1 and v.banawards != 2: abort(403) + + if v.banawards != 1 and v.banawards != 2: return "You must have a ban award to ban this user. You can obtain it here:\nhttps://rdrama.gumroad.com/l/tfcvri\nhttps://www.patreon.com/Aevann" comment = g.db.query(Comment).filter_by(id=comment_id).first() if not comment: abort(400) diff --git a/ruqqus/routes/posts.py b/ruqqus/routes/posts.py index 71422472d..11b532275 100644 --- a/ruqqus/routes/posts.py +++ b/ruqqus/routes/posts.py @@ -32,11 +32,11 @@ with open("snappy.txt", "r") as f: snappyquotes = f.read().split("{[para]}") -@app.route("/banaward/", methods=["POST"]) +@app.route("/banaward/post/", methods=["POST"]) @auth_required -def banaward(post_id, v): +def postbanaward(post_id, v): - if v.banawards != 1 and v.banawards != 2: abort(403) + if v.banawards != 1 and v.banawards != 2: return "You must have a ban award to ban this user. You can obtain it here:\nhttps://rdrama.gumroad.com/l/tfcvri\nhttps://www.patreon.com/Aevann" post = g.db.query(Submission).filter_by(id=post_id).first() if not post: abort(400) diff --git a/ruqqus/templates/comments.html b/ruqqus/templates/comments.html index 5939a6739..cd4ad8aa4 100644 --- a/ruqqus/templates/comments.html +++ b/ruqqus/templates/comments.html @@ -242,6 +242,8 @@
  • Votes
  • +
  • Ban user
  • + {% if v and c.id in v.saved_comment_idlist() %}
  • Unsave
  • {% else %} @@ -447,6 +449,8 @@
  • Votes
  • +
  • Ban user
  • + {% if v and c.id in v.saved_comment_idlist() %}
  • Unsave
  • {% else %} diff --git a/ruqqus/templates/submission.html b/ruqqus/templates/submission.html index 489d98ac0..057fc4bdc 100644 --- a/ruqqus/templates/submission.html +++ b/ruqqus/templates/submission.html @@ -132,6 +132,8 @@ + + {% if v and p.id in v.subscribed_idlist() %} {% elif v %} @@ -320,6 +322,8 @@
  • Votes
  • +
  • Ban user
  • +
  • Copy link
  • {% if v and p.id in v.subscribed_idlist() %} diff --git a/ruqqus/templates/submission_listing.html b/ruqqus/templates/submission_listing.html index 0e166eaa2..283d66dd3 100644 --- a/ruqqus/templates/submission_listing.html +++ b/ruqqus/templates/submission_listing.html @@ -168,6 +168,8 @@
  • Votes
  • +
  • Ban user
  • +
  • Copy link
  • {% if v and p.id in v.subscribed_idlist() %} @@ -346,6 +348,8 @@