master
Aevann1 2021-12-02 20:45:03 +02:00
parent 894d6404b8
commit f066ab94c9
5 changed files with 11 additions and 11 deletions

View File

@ -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"<p>{cc} ONLY</p>"
if self.post and self.post.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{cc} ONLY</p>"
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"<p>{cc} ONLY</p>"
if self.post and self.post.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{cc} ONLY</p>"
body = self.body

View File

@ -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"<p>{cc} ONLY</p>"
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{cc} ONLY</p>"
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"<p>{cc} ONLY</p>"
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{cc} ONLY</p>"
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

View File

@ -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

View File

@ -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:

View File

@ -143,7 +143,7 @@
<div class="card-header bg-transparent border-0 d-flex flex-row flex-nowrap pl-2 pl-md-0 p-0 mr-md-2">
<div style="z-index: 3;">
{% if p.club and not (v and v.paid_dues) %}
{% if p.club and not (v and (v.paid_dues or v.id == p.author_id)) %}
<img loading="lazy" src="/assets/images/emojis/marseyglow.webp" class="post-img">
{% elif not p.url %}
<a {% if v and v.newtab %}target="_blank"{% endif %} {% if v %}href="{{p.permalink}}"{% else %}href="/logged_out{{p.permalink}}"{% endif %}>
@ -467,7 +467,7 @@
</div>
{% if not p.club or v and v.paid_dues %}
{% if not p.club or v and (v.paid_dues or v.id == p.author_id) %}
{% if p.realbody(v) %}
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.id}}">
{{p.realbody(v) | safe}}