master
Aevann1 2021-12-01 14:59:23 +02:00
parent 8271debb42
commit 1a8d9b6a0c
2 changed files with 8 additions and 8 deletions

View File

@ -13,8 +13,8 @@ from .flags import CommentFlag
from random import randint from random import randint
site = environ.get("DOMAIN").strip() site = environ.get("DOMAIN").strip()
if site == 'pcmemes.net': cc = "splash mountain" if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
else: cc = "country club" else: cc = "COUNTRY CLUB"
class Comment(Base): class Comment(Base):
@ -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): return f"<p>{cc} ONLY</p>" 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>"
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): return f"<p>{cc} ONLY</p>" 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>"
body = self.body body = self.body

View File

@ -6,8 +6,8 @@ from files.helpers.lazy import lazy
from os import environ from os import environ
site = environ.get("DOMAIN").strip() site = environ.get("DOMAIN").strip()
if site == 'pcmemes.net': cc = "splash mountain" if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
else: cc = "country club" else: cc = "COUNTRY CLUB"
class ModAction(Base): class ModAction(Base):
__tablename__ = "modactions" __tablename__ = "modactions"
@ -82,7 +82,7 @@ class ModAction(Base):
@lazy @lazy
def string(self): def string(self):
output = ACTIONTYPES[self.kind]["str"].format(self=self, cc=cc) output = ACTIONTYPES[self.kind]["str"].format(self=self)
if self.note: output += f" <i>({self.note})</i>" if self.note: output += f" <i>({self.note})</i>"
@ -93,7 +93,7 @@ class ModAction(Base):
def target_link(self): def target_link(self):
if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>' if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
elif self.target_post: elif self.target_post:
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{cc.upper()} ONLY</a>' if self.target_post.club: return f'<a href="{self.target_post.permalink}">{cc} ONLY</a>'
return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>' return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>'
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}?context=9#context">comment</a>' elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}?context=9#context">comment</a>'