forked from MarseyWorld/MarseyWorld
dsads
parent
894d6404b8
commit
f066ab94c9
|
@ -305,7 +305,7 @@ class Comment(Base):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def realbody(self, v):
|
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
|
body = self.body_html
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ class Comment(Base):
|
||||||
return body
|
return body
|
||||||
|
|
||||||
def plainbody(self, v):
|
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
|
body = self.body
|
||||||
|
|
||||||
|
|
|
@ -319,7 +319,7 @@ class Submission(Base):
|
||||||
else: return ""
|
else: return ""
|
||||||
|
|
||||||
def realbody(self, v):
|
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 = self.body_html
|
||||||
body = censor_slurs(body, v)
|
body = censor_slurs(body, v)
|
||||||
|
@ -342,7 +342,7 @@ class Submission(Base):
|
||||||
return body
|
return body
|
||||||
|
|
||||||
def plainbody(self, v):
|
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 = self.body
|
||||||
body = censor_slurs(body, v)
|
body = censor_slurs(body, v)
|
||||||
|
@ -357,7 +357,7 @@ class Submission(Base):
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
def realtitle(self, v):
|
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)
|
if v: return random.choice(TROLLTITLES).format(username=v.username)
|
||||||
else: return f'{cc} MEMBERS ONLY'
|
else: return f'{cc} MEMBERS ONLY'
|
||||||
elif self.title_html: title = self.title_html
|
elif self.title_html: title = self.title_html
|
||||||
|
@ -369,7 +369,7 @@ class Submission(Base):
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
def plaintitle(self, v):
|
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)
|
if v: return random.choice(TROLLTITLES).format(username=v.username)
|
||||||
else: return f'{cc} MEMBERS ONLY'
|
else: return f'{cc} MEMBERS ONLY'
|
||||||
else: title = self.title
|
else: title = self.title
|
||||||
|
|
|
@ -45,7 +45,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
g.db.commit()
|
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)
|
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_fullname = request.values.get("parent_fullname").strip()
|
||||||
|
|
||||||
parent_post = get_post(parent_submission, v=v)
|
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_"):
|
if parent_fullname.startswith("t2_"):
|
||||||
parent = parent_post
|
parent = parent_post
|
||||||
|
|
|
@ -125,7 +125,7 @@ def post_id(pid, anything=None, v=None):
|
||||||
|
|
||||||
post = get_post(pid, v=v)
|
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:
|
if v:
|
||||||
|
|
|
@ -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 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;">
|
<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">
|
<img loading="lazy" src="/assets/images/emojis/marseyglow.webp" class="post-img">
|
||||||
{% elif not p.url %}
|
{% 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 %}>
|
<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>
|
</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) %}
|
{% if p.realbody(v) %}
|
||||||
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.id}}">
|
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.id}}">
|
||||||
{{p.realbody(v) | safe}}
|
{{p.realbody(v) | safe}}
|
||||||
|
|
Loading…
Reference in New Issue