From a88b9d59c4e86bdd74c912e1db9a543f54dc3b7a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 20 Aug 2022 00:20:25 +0200 Subject: [PATCH] rename /h/chudtopia to /h/chudrama --- files/routes/admin.py | 4 ++-- files/routes/comments.py | 10 +++++----- files/routes/front.py | 2 +- files/routes/posts.py | 14 +++++++------- files/templates/comments.html | 8 ++++---- files/templates/submission.html | 6 +++--- files/templates/submission_listing.html | 6 +++--- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 9f603d924..207dabcb2 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1127,7 +1127,7 @@ def approve_post(post_id, v): post = get_post(post_id) - if post.author.id == v.id and post.author.agendaposter and AGENDAPOSTER_PHRASE not in post.body.lower() and post.sub != 'chudtopia': + if post.author.id == v.id and post.author.agendaposter and AGENDAPOSTER_PHRASE not in post.body.lower() and post.sub != 'chudrama': return {"error": "You can't bypass the chud award!"} if not post: @@ -1322,7 +1322,7 @@ def approve_comment(c_id, v): comment = get_comment(c_id) if not comment: abort(404) - if comment.author.id == v.id and comment.author.agendaposter and AGENDAPOSTER_PHRASE not in comment.body.lower() and comment.post.sub != 'chudtopia': + if comment.author.id == v.id and comment.author.agendaposter and AGENDAPOSTER_PHRASE not in comment.body.lower() and comment.post.sub != 'chudrama': return {"error": "You can't bypass the chud award!"} if comment.is_banned: diff --git a/files/routes/comments.py b/files/routes/comments.py index 660b0fffd..fdda20d64 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -280,13 +280,13 @@ def comment(v): with open(f"snappy_{SITE_NAME}.txt", "a", encoding="utf-8") as f: f.write('\n{[para]}\n' + body) - if v.agendaposter and not v.marseyawarded and parent_post.id not in ADMIGGERS and parent_post.sub != 'chudtopia': + if v.agendaposter and not v.marseyawarded and parent_post.id not in ADMIGGERS and parent_post.sub != 'chudrama': body = torture_ap(body, v.username) body_html = sanitize(body, limit_pings=True) - if parent_post.id not in ADMIGGERS and '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower() and parent_post.sub != 'chudtopia': + if parent_post.id not in ADMIGGERS and '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower() and parent_post.sub != 'chudrama': existing = g.db.query(Comment.id).filter(Comment.author_id == v.id, Comment.deleted_utc == 0, Comment.parent_comment_id == parent_comment_id, @@ -416,7 +416,7 @@ def comment(v): n = Notification(comment_id=c_based.id, user_id=v.id) g.db.add(n) - if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and parent_post.sub != 'chudtopia': + if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and parent_post.sub != 'chudrama': c.is_banned = True c.ban_reason = "AutoJanny" @@ -654,7 +654,7 @@ def edit_comment(cid, v): elif v.bird and len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403 - if v.agendaposter and not v.marseyawarded and c.post.sub != 'chudtopia': + if v.agendaposter and not v.marseyawarded and c.post.sub != 'chudrama': body = torture_ap(body, v.username) for i in poll_regex.finditer(body): @@ -731,7 +731,7 @@ def edit_comment(cid, v): notif = Notification(comment_id=c.id, user_id=CARP_ID) g.db.add(notif) - if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and c.post.sub != 'chudtopia': + if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and c.post.sub != 'chudrama': return {"error": f'You have to include "{AGENDAPOSTER_PHRASE}" in your comment!'}, 403 diff --git a/files/routes/front.py b/files/routes/front.py index 5fc3b092d..4a424e945 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -29,7 +29,7 @@ def front_all(v, sub=None, subdomain=None): if sub: sub = sub.strip().lower() - if sub == 'chudtopia' and not (v and v.truecoins >= 20000): abort(403) + if sub == 'chudrama' and not (v and v.truecoins >= 20000): abort(403) sub = g.db.query(Sub).filter_by(name=sub).one_or_none() if (request.path.startswith('/h/') or request.path.startswith('/s/')) and not sub: abort(404) diff --git a/files/routes/posts.py b/files/routes/posts.py index 38948e1b3..1361aa1ea 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -406,7 +406,7 @@ def edit_post(pid, v): return {"error":"You have to type less than 140 characters!"}, 403 if title != p.title: - if v.id == p.author_id and v.agendaposter and not v.marseyawarded and p.sub != 'chudtopia': + if v.id == p.author_id and v.agendaposter and not v.marseyawarded and p.sub != 'chudrama': title = torture_ap(title, v.username) title_html = filter_emojis_only(title, edit=True) @@ -422,7 +422,7 @@ def edit_post(pid, v): body = body.strip() if body != p.body: - if v.id == p.author_id and v.agendaposter and not v.marseyawarded and p.sub != 'chudtopia': + if v.id == p.author_id and v.agendaposter and not v.marseyawarded and p.sub != 'chudrama': body = torture_ap(body, v.username) for i in poll_regex.finditer(body): @@ -461,7 +461,7 @@ def edit_post(pid, v): p.body_html = body_html - if v.id == p.author_id and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{p.body}{p.title}'.lower() and p.sub != 'chudtopia': + if v.id == p.author_id and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{p.body}{p.title}'.lower() and p.sub != 'chudrama': return {"error": f'You have to include "{AGENDAPOSTER_PHRASE}" in your post!'}, 403 @@ -719,7 +719,7 @@ def submit_post(v, sub=None): if v.is_suspended: return error("You can't perform this action while banned.") - if v.agendaposter and not v.marseyawarded and sub != 'chudtopia': + if v.agendaposter and not v.marseyawarded and sub != 'chudrama': title = torture_ap(title, v.username) title_html = filter_emojis_only(title, graceful=True) @@ -890,7 +890,7 @@ def submit_post(v, sub=None): choices.append(i.group(1)) body = body.replace(i.group(0), "") - if v.agendaposter and not v.marseyawarded and sub != 'chudtopia': + if v.agendaposter and not v.marseyawarded and sub != 'chudrama': body = torture_ap(body, v.username) body += process_files() @@ -1014,7 +1014,7 @@ def submit_post(v, sub=None): for x in notify_users: add_notif(cid, x) - if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{post.body}{post.title}'.lower() and sub != 'chudtopia': + if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{post.body}{post.title}'.lower() and sub != 'chudrama': post.is_banned = True post.ban_reason = "AutoJanny" @@ -1078,7 +1078,7 @@ def submit_post(v, sub=None): post.downvotes += 1 g.db.add(post) - if SITE == 'rdrama.net' and post.sub and post.sub not in ('dankchristianmemes','fatpeoplehate','braincels','truth','smuggies','chudtopia') and v.id != AEVANN_ID: + if SITE == 'rdrama.net' and post.sub and post.sub not in ('dankchristianmemes','fatpeoplehate','braincels','truth','smuggies','chudrama') and v.id != AEVANN_ID: g.db.flush() autovote = Vote( user_id=AEVANN_ID, diff --git a/files/templates/comments.html b/files/templates/comments.html index deed25fcf..5dab5362d 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -90,7 +90,7 @@ {% if render_replies %} {% if level<9 or request.path.startswith('/notifications') or request.headers.get("xhr") %}
- {% for reply in replies if not reply.parent_submission or reply.post.sub != 'chudtopia' or (v and v.truecoins >= 20000) %} + {% for reply in replies if not reply.parent_submission or reply.post.sub != 'chudrama' or (v and v.truecoins >= 20000) %} {{single_comment(reply, level=level+1)}} {% endfor %}
@@ -300,7 +300,7 @@ {% endif %} -
+
{{c.realbody(v) | safe}}
{% if c.parent_submission %} @@ -601,7 +601,7 @@ {% if render_replies %} {% if level<9 or request.path.startswith('/notifications') or request.headers.get("xhr") %}
- {% for reply in replies if not reply.parent_submission or reply.post.sub != 'chudtopia' or (v and v.truecoins >= 20000) %} + {% for reply in replies if not reply.parent_submission or reply.post.sub != 'chudrama' or (v and v.truecoins >= 20000) %} {{single_comment(reply, level=level+1)}} {% endfor %}
@@ -785,7 +785,7 @@ {% endmacro %} -{% for comment in comments if not comment.parent_submission or comment.post.sub != 'chudtopia' or (v and v.truecoins >= 20000) %} +{% for comment in comments if not comment.parent_submission or comment.post.sub != 'chudrama' or (v and v.truecoins >= 20000) %} {{single_comment(comment)}} diff --git a/files/templates/submission.html b/files/templates/submission.html index daeb5b891..a93f5134f 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -705,14 +705,14 @@
{% endif %} {% if p.realurl(v) and not v_forbid_deleted %} -

+

{% if p.club %}{{CC}}{% endif %} {% if p.category %}{{help.submission_category_tag(p.category.name, p.category.color_text, p.category.color_bg)}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} {{p.realtitle(v) | safe}}

{% else %} -

+

{% if p.club %}{{CC}}{% endif %} {% if p.category %}{{help.submission_category_tag(p.category.name, p.category.color_text, p.category.color_bg)}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} @@ -748,7 +748,7 @@ {% endif %} -
+
{% if p.is_image %}
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 97e80d167..452cf628e 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -58,7 +58,7 @@
-{% for p in listing if p.sub != 'chudtopia' or (v and v.truecoins >= 20000) %} +{% for p in listing if p.sub != 'chudrama' or (v and v.truecoins >= 20000) %} {% set ups=p.upvotes %} {% set downs=p.downvotes %} @@ -231,7 +231,7 @@
- + {% if p.club %}{{CC}}{% endif %} {% if p.category %}{{help.submission_category_tag(p.category.name, p.category.color_text, p.category.color_bg)}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} @@ -355,7 +355,7 @@ {% if (not p.club or v and (v.paid_dues or v.id == p.author_id)) and not v_forbid_deleted %} {% if p.realbody(v, True) %} -
+
{{p.realbody(v, True) | safe}}
{% endif %}