From 0c97ade24d562fd8ee14d5c263f6d3bef152b350 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 13 Sep 2021 23:04:28 +0200 Subject: [PATCH] fd --- files/classes/user.py | 5 ++++- files/routes/comments.py | 2 +- files/routes/posts.py | 2 +- files/templates/submission.html | 4 ++-- files/templates/submission_listing.html | 8 ++++---- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 376afbad8..3c476c5ad 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -157,6 +157,9 @@ class User(Base, Stndrd, Age_times): return g.db.query(UserBlock).filter_by( user_id=self.id, target_id=target.id).first() + def paid_dues(self): + return self.truecoins > environ.get("DUES").strip() + def any_block_exists(self, other): return g.db.query(UserBlock).filter( @@ -229,7 +232,7 @@ class User(Base, Stndrd, Age_times): if not v: comments = comments.filter(Submission.club == False) - elif v.admin_level < 3 and (v.coins < 750 or v.club_banned): + elif v.admin_level < 3 and (not v.paid_dues or v.club_banned): comments = comments.filter(Submission.club == False) now = int(time.time()) diff --git a/files/routes/comments.py b/files/routes/comments.py index 818288275..d060874b9 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -42,7 +42,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None): if comment.post and comment.post.club: if not v: abort(403) - elif v.admin_level < 3 and (v.coins < 750 or v.club_banned): + elif v.admin_level < 3 and (not v.paid_dues or v.club_banned): abort(403) if not comment.parent_submission and not (v and (comment.author.id == v.id or comment.sentto == v.id)) and not (v and v.admin_level == 6) : abort(403) diff --git a/files/routes/posts.py b/files/routes/posts.py index f52806aee..0dbbb352c 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -99,7 +99,7 @@ def post_id(pid, anything=None, v=None): if post.club: if not v: abort(403) - elif v.admin_level < 3 and (v.coins < 750 or v.club_banned): + elif v.admin_level < 3 and (not v.paid_dues or v.club_banned): abort(403) diff --git a/files/templates/submission.html b/files/templates/submission.html index 26370c782..ca06ea9c3 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -132,7 +132,7 @@ - {% if v.admin_level >=3 or v.id == p.author.id and v.coins > 750 %} + {% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %} {% endif %} @@ -448,7 +448,7 @@ {% endif %} {% if v %} - {% if v.admin_level >=3 or v.id == p.author.id and v.coins > 750 %} + {% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
  • Mark club
  • Unmark club
  • {% endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 847d9ecae..c6d29066f 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -64,7 +64,7 @@
    - {% if p.club and not (v and v.coins > 750) %} + {% if p.club and not (v and v.paid_dues) %} {% elif not p.url %} @@ -174,7 +174,7 @@ {% endif %} {% if v %} - {% if v.admin_level >=3 or v.id == p.author.id and v.coins > 750 %} + {% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %}
  • Mark club
  • Unmark club
  • {% endif %} @@ -321,7 +321,7 @@ - {% if v.admin_level >=3 or v.id == p.author.id and v.coins > 750 %} + {% if v.admin_level >=3 or v.id == p.author.id and v.paid_dues %} {% endif %} @@ -377,7 +377,7 @@
    -{% if not p.club or v and v.coins > 750 %} +{% if not p.club or v and v.paid_dues %} {% if p.active_flags %}
    Reported by: