From 959e08bb8310cd2f314120c78fa1680047905f92 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Sep 2022 10:49:34 +0200 Subject: [PATCH] make marsify not count towards /marseys --- files/helpers/sanitize.py | 4 ++-- files/routes/awards.py | 4 ++-- files/routes/comments.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 22a51e60f..2f8422c04 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -193,7 +193,7 @@ def with_sigalrm_timeout(timeout: int): @with_sigalrm_timeout(2) -def sanitize(sanitized, edit=False, limit_pings=0, showmore=True): +def sanitize(sanitized, edit=False, limit_pings=0, showmore=True, marsified=False): sanitized = sanitized.strip() sanitized = normalize_url(sanitized) @@ -322,7 +322,7 @@ def sanitize(sanitized, edit=False, limit_pings=0, showmore=True): sanitized = video_sub_regex.sub(r'\1', sanitized) sanitized = audio_sub_regex.sub(r'\1', sanitized) - if not edit: + if not edit and not marsified: for marsey in g.db.query(Marsey).filter(Marsey.name.in_(marseys_used)).all(): marsey.count += 1 g.db.add(marsey) diff --git a/files/routes/awards.py b/files/routes/awards.py index df9cbed79..1432ab15d 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -360,7 +360,7 @@ def award_thing(v, thing_type, id): body = thing.body body = owoify(body) if author.marsify: body = marsify(body) - thing.body_html = sanitize(body, limit_pings=5) + thing.body_html = sanitize(body, limit_pings=5, marsified=True) g.db.add(thing) elif ("Femboy" in kind and kind == v.house) or kind == 'marsify': if author.marsify: author.marsify += 21600 @@ -370,7 +370,7 @@ def award_thing(v, thing_type, id): body = thing.body if author.owoify: body = owoify(body) body = marsify(body) - thing.body_html = sanitize(body, limit_pings=5) + thing.body_html = sanitize(body, limit_pings=5, marsified=True) g.db.add(thing) if author.received_award_count: author.received_award_count += 1 diff --git a/files/routes/comments.py b/files/routes/comments.py index ae574206a..a006a61f2 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -341,7 +341,7 @@ def comment(v): if v.marsify: body_for_sanitize = marsify(body_for_sanitize) - body_html = sanitize(body_for_sanitize, limit_pings=5) + body_html = sanitize(body_for_sanitize, limit_pings=5, marsified=True) if parent_post.id not in ADMIGGERS and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower(): @@ -772,7 +772,7 @@ def edit_comment(cid, v): if v.marsify: body_for_sanitize = marsify(body_for_sanitize) - body_html = sanitize(body_for_sanitize, edit=True, limit_pings=5) + body_html = sanitize(body_for_sanitize, edit=True, limit_pings=5, marsified=True) if len(body_html) > 20000: abort(400)