From 4a0691bfc9dc3aec304e401dbced38790b1b7348 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 6 Feb 2024 21:39:52 +0200 Subject: [PATCH] rename is_effortpost to is_longpost --- files/classes/comment.py | 2 +- files/classes/post.py | 2 +- files/helpers/sanitize.py | 4 ++-- files/routes/awards.py | 4 ++-- files/routes/posts.py | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index f71a92841..5b44c9e93 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -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): diff --git a/files/classes/post.py b/files/classes/post.py index 7d688cc4e..cbd9c4846 100644 --- a/files/classes/post.py +++ b/files/classes/post.py @@ -395,5 +395,5 @@ class Post(Base): @property @lazy - def is_effortpost(self): + def is_longpost(self): return len(self.body) >= 2000 diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 2f53894b5..2eac41820 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -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 '

g

' - 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: diff --git a/files/routes/awards.py b/files/routes/awards.py index 5ea0fff99..c8cd15ae7 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -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): diff --git a/files/routes/posts.py b/files/routes/posts.py index 7079a2e2d..ef0af3840 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -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)