From f2039d77137e3eae6715528d1e6f24205a7f5c7f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 7 May 2022 06:13:19 +0200 Subject: [PATCH] sfd --- files/classes/submission.py | 2 +- files/classes/user.py | 1 + files/helpers/const.py | 12 +++--------- files/helpers/discord.py | 8 +------- files/routes/front.py | 2 +- files/routes/posts.py | 10 +++------- files/routes/static.py | 8 ++++---- files/templates/emoji_modal.html | 22 +++++++++++----------- 8 files changed, 25 insertions(+), 40 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index ed9e0e860f..34484ab157 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -452,7 +452,7 @@ class Submission(Base): def realtitle(self, v): if self.club and not (v and (v.paid_dues or v.id == self.author_id)): if v: return random.choice(TROLLTITLES).format(username=v.username) - elif SITE == 'cringetopia.org': return f'Please make an account to see this post' + elif dues == -2: return f'Please make an account to see this post' else: return f'{CC} MEMBERS ONLY' elif self.title_html: title = self.title_html else: title = self.title diff --git a/files/classes/user.py b/files/classes/user.py index 7769880eb6..e940e6656c 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -192,6 +192,7 @@ class User(Base): if not self.has_badge(134): new_badge = Badge(badge_id=134, user_id=self.id) g.db.add(new_badge) + g.db.commit() return True return False diff --git a/files/helpers/const.py b/files/helpers/const.py index 24b2064cca..45fac0a70d 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -32,8 +32,8 @@ if SITE_NAME == 'Cringetopia': SLURS = { "retarded": "neurodivergent", "retard": "neurodivergent", - "faggotry": "cute twinkry", "faggot": "cute twink", + "fag": "cute twink", "n1gger": "🏀", "nlgger": "🏀", "nigger": "🏀", @@ -43,11 +43,7 @@ if SITE_NAME == 'Cringetopia': "autistic": "neurodivergent", "holohoax": "i tried to claim the Holocaust didn't happen because I am a pencil-dicked imbecile and the word filter caught me lol", "i hate carp": "i love Carp", - "heil hitler": "hello kitty", - - " fag ": " cute twink ", - " fags ": " cute twinks ", - } + "heil hitler": "hello kitty", } else: SLURS = { "california": "commiefornia", @@ -61,8 +57,8 @@ else: "richfag": "richstrag", "newfag": "newstrag", "oldfag": "oldstrag", - "faggotry": "cute twinkry", "faggot": "cute twink", + "fag": "cute twink", "pedophile": "libertarian", "kill yourself": "keep yourself safe", "n1gger": "BIPOC", @@ -114,8 +110,6 @@ else: " kys ": " keep yourself safe ", " pedo ": " libertarian ", " pedos ": " libertarians ", - " fag ": " cute twink ", - " fags ": " cute twinks ", } single_words = "|".join([slur.lower() for slur in SLURS.keys()]) diff --git a/files/helpers/discord.py b/files/helpers/discord.py index c5bc3f1680..e8ac3df002 100644 --- a/files/helpers/discord.py +++ b/files/helpers/discord.py @@ -57,10 +57,4 @@ def send_discord_message(message): headers = {"Authorization": f"Bot {BOT_TOKEN}"} data={"content": message} requests.post("https://discordapp.com/api/channels/924485611715452940/messages", headers=headers, data=data, timeout=5) - requests.post("https://discordapp.com/api/channels/924486091795484732/messages", headers=headers, data=data, timeout=5) - - -def send_cringetopia_message(message): - headers = {"Authorization": f"Bot {BOT_TOKEN}"} - data={"content": message} - requests.post("https://discordapp.com/api/channels/965264044531527740/messages", headers=headers, data=data, timeout=5) \ No newline at end of file + requests.post("https://discordapp.com/api/channels/924486091795484732/messages", headers=headers, data=data, timeout=5) \ No newline at end of file diff --git a/files/routes/front.py b/files/routes/front.py index 3730959419..82967c68d2 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -353,7 +353,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false" posts = posts.join(User, User.id == Submission.author_id).filter(User.shadowbanned == None) if request.host == 'rdrama.net': num = 5 - else: num = 1 + else: num = 0.5 if sort == "hot": ti = int(time.time()) + 3600 diff --git a/files/routes/posts.py b/files/routes/posts.py index 778224b903..26b999747a 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -4,7 +4,7 @@ import requests from files.helpers.wrappers import * from files.helpers.sanitize import * from files.helpers.alerts import * -from files.helpers.discord import send_discord_message, send_cringetopia_message +from files.helpers.discord import send_discord_message from files.helpers.const import * from files.helpers.slots import * from files.classes import * @@ -90,9 +90,7 @@ def publish(pid, v): cache.delete_memoized(frontlist) cache.delete_memoized(User.userpagelisting) - if SITE == 'cringetopia.org': - send_cringetopia_message(post.permalink) - elif v.admin_level > 0 and ("[changelog]" in post.title.lower() or "(changelog)" in post.title.lower()): + if v.admin_level > 0 and ("[changelog]" in post.title.lower() or "(changelog)" in post.title.lower()): send_discord_message(post.permalink) cache.delete_memoized(changeloglist) @@ -1392,9 +1390,7 @@ def submit_post(v, sub=None): cache.delete_memoized(frontlist) cache.delete_memoized(User.userpagelisting) - if SITE == 'cringetopia.org': - send_cringetopia_message(post.permalink) - elif v.admin_level > 0 and ("[changelog]" in post.title.lower() or "(changelog)" in post.title.lower()) and not post.private: + if v.admin_level > 0 and ("[changelog]" in post.title.lower() or "(changelog)" in post.title.lower()) and not post.private: send_discord_message(post.permalink) cache.delete_memoized(changeloglist) diff --git a/files/routes/static.py b/files/routes/static.py index c7cedb4b16..25f00d4189 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -34,13 +34,13 @@ def marseys(v): def marsey_list(): # From database emojis = [{ - "name": emoij.name, + "name": emoji.name, "author": author if SITE_NAME == 'rDrama' else "rDrama's chads", # yikes, I don't really like this DB schema. Next time be better - "tags": emoij.tags.split(" ") + [emoij.name[len("marsey"):] if emoij.name.startswith("marsey") else emoij.name] + ([author] if SITE_NAME == 'rDrama' else []), - "count": emoij.count, + "tags": emoji.tags.split(" ") + [emoji.name[len("marsey"):] if emoji.name.startswith("marsey") else emoji.name] + ([author] if SITE_NAME == 'rDrama' else []), + "count": emoji.count, "class": "Marsey" - } for emoij, author in g.db.query(Marsey, User.username).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc())] + } for emoji, author in g.db.query(Marsey, User.username).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc())] # Stastic shit shit = open("files/assets/shit emojis.json", "r", encoding="utf-8") diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 581eefba7e..be3edcbbac 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -29,19 +29,19 @@