diff --git a/files/classes/comment.py b/files/classes/comment.py index 975264e7dc..d4c7063364 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -305,7 +305,7 @@ class Comment(Base): return data def realbody(self, v): - if self.post and self.post.club and not (v and v.paid_dues) and not (v and v.id == self.author_id): return f"
{cc} ONLY
" + if self.post and self.post.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"{cc} ONLY
" body = self.body_html @@ -342,7 +342,7 @@ class Comment(Base): return body def plainbody(self, v): - if self.post and self.post.club and not (v and v.paid_dues) and not (v and v.id == self.author_id): return f"{cc} ONLY
" + if self.post and self.post.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"{cc} ONLY
" body = self.body diff --git a/files/classes/submission.py b/files/classes/submission.py index 6781104087..10fde99f91 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -319,7 +319,7 @@ class Submission(Base): else: return "" def realbody(self, v): - if self.club and not (v and v.paid_dues): return f"{cc} ONLY
" + if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"{cc} ONLY
" body = self.body_html body = censor_slurs(body, v) @@ -342,7 +342,7 @@ class Submission(Base): return body def plainbody(self, v): - if self.club and not (v and v.paid_dues): return f"{cc} ONLY
" + if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"{cc} ONLY
" body = self.body body = censor_slurs(body, v) @@ -357,7 +357,7 @@ class Submission(Base): @lazy def realtitle(self, v): - if self.club and not (v and v.paid_dues) and not (v and v.admin_level > 1): + if self.club and not (v and (v.paid_dues or v.id == self.author_id)): if v: return random.choice(TROLLTITLES).format(username=v.username) else: return f'{cc} MEMBERS ONLY' elif self.title_html: title = self.title_html @@ -369,7 +369,7 @@ class Submission(Base): @lazy def plaintitle(self, v): - if self.club and not (v and v.paid_dues) and not (v and v.admin_level > 1): + if self.club and not (v and (v.paid_dues or v.id == self.author_id)): if v: return random.choice(TROLLTITLES).format(username=v.username) else: return f'{cc} MEMBERS ONLY' else: title = self.title diff --git a/files/routes/comments.py b/files/routes/comments.py index 61deea83b7..292c84ebf3 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -45,7 +45,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None): g.db.add(notif) g.db.commit() - if comment.post and comment.post.club and not (v and v.paid_dues): abort(403) + if comment.post and comment.post.club and not (v and (v.paid_dues or v.id in [post.author_id, comment.post.author_id])): 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 > 1) : abort(403) @@ -142,7 +142,7 @@ def api_comment(v): parent_fullname = request.values.get("parent_fullname").strip() parent_post = get_post(parent_submission, v=v) - if parent_post.club and not (v and v.paid_dues): abort(403) + if parent_post.club and not (v and (v.paid_dues or v.id == parent_post.author_id)): abort(403) if parent_fullname.startswith("t2_"): parent = parent_post diff --git a/files/routes/posts.py b/files/routes/posts.py index e175e0f05a..807d3cb953 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -125,7 +125,7 @@ def post_id(pid, anything=None, v=None): post = get_post(pid, v=v) - if post.club and not (v and v.paid_dues) or post.private and not (v and (v.id == post.author_id or v.admin_level > 1)): abort(403) + if post.club and not (v and (v.paid_dues or v.id == post.author_id)) or post.private: abort(403) if v: diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 68f807ca6d..d1cfb0d4f8 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -143,7 +143,7 @@