rename is_effortpost to is_longpost

pull/222/head
Aevann 2024-02-06 21:39:52 +02:00
parent f5ccf5c693
commit 4a0691bfc9
5 changed files with 10 additions and 10 deletions

View File

@ -514,7 +514,7 @@ class Comment(Base):
@property
@lazy
def is_effortpost(self):
def is_longpost(self):
return len(self.body) >= 2000
def pin_parents(self):

View File

@ -395,5 +395,5 @@ class Post(Base):
@property
@lazy
def is_effortpost(self):
def is_longpost(self):
return len(self.body) >= 2000

View File

@ -395,7 +395,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
if blackjack and execute_blackjack(v, None, sanitized, blackjack):
return '<p>g</p>'
if obj and not obj.is_effortpost:
if obj and not obj.is_longpost:
if author.owoify:
sanitized = owoify(sanitized, author.chud_phrase)
if author.marsify:
@ -702,7 +702,7 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None, author=
title = remove_cuniform(title)
if obj and not obj.is_effortpost:
if obj and not obj.is_longpost:
if author.owoify:
title = owoify(title, author.chud_phrase)
if author.marsify:

View File

@ -261,7 +261,7 @@ def award_thing(v, thing_type, id):
link = f"[this {thing_type}]({obj.shortlink})"
can_alter_body = not obj.is_effortpost and (not obj.author.deflector or v == obj.author)
can_alter_body = not obj.is_longpost and (not obj.author.deflector or v == obj.author)
if kind == "ban":
link = f"/{thing_type}/{obj.id}"
@ -555,7 +555,7 @@ def award_thing(v, thing_type, id):
if v.id == author.id:
session['event_music'] = False
elif kind in {"ectoplasm", "candycorn", "candycane", "stab", "tilt"}:
if obj.is_effortpost:
if obj.is_longpost:
abort(403, f'Effortposts are protected from the {award_title} award!')
elif kind == "gold":
if obj.award_count('glowie', v):

View File

@ -569,10 +569,10 @@ def submit_post(v, hole=None):
)
p.chudded = v.chud and hole != 'chudrama' and not (p.is_effortpost and not v.chudded_by)
p.queened = v.queen and not p.is_effortpost
p.sharpened = v.sharpen and not p.is_effortpost
p.rainbowed = v.rainbow and not p.is_effortpost
p.chudded = v.chud and hole != 'chudrama' and not (p.is_longpost and not v.chudded_by)
p.queened = v.queen and not p.is_longpost
p.sharpened = v.sharpen and not p.is_longpost
p.rainbowed = v.rainbow and not p.is_longpost
title_html = filter_emojis_only(title, count_emojis=True, obj=p, author=v)