From b0cf28b15c5f1c60826fb4b50c07501f0734b4a5 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:22:52 +0200 Subject: [PATCH] dfsfsd --- files/classes/user.py | 2 +- files/routes/admin.py | 12 ++++++------ files/routes/comments.py | 10 +++++----- files/routes/discord.py | 2 +- files/routes/front.py | 2 +- files/routes/login.py | 2 +- files/routes/posts.py | 8 ++++---- files/routes/settings.py | 2 +- files/templates/comments.html | 6 +++--- files/templates/default.html | 4 ++-- files/templates/errors/patron.html | 2 +- files/templates/header.html | 10 +++++----- files/templates/sign_up.html | 2 +- files/templates/submission.html | 8 ++++---- files/templates/submission_listing.html | 6 +++--- files/templates/userpage.html | 8 ++++---- files/templates/userpage_private.html | 2 +- 17 files changed, 44 insertions(+), 44 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index dd5030171..db6479ad7 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -429,7 +429,7 @@ class User(Base): @lazy def profile_url(self): if self.profileurl: return self.profileurl - elif "rdrama" in site: return f"https://{site}/assets/images/defaultpictures/{random.randint(1, 150)}.webp" + elif "rama" in site: return f"https://{site}/assets/images/defaultpictures/{random.randint(1, 150)}.webp" else: return f"https://{site}/assets/images/default-profile-pic.webp" @property diff --git a/files/routes/admin.py b/files/routes/admin.py index 6bb8d5a57..cb3118e40 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -31,7 +31,7 @@ def truescore(v): @limiter.limit("1/second") @admin_level_required(6) def revert_actions(v, username): - if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host): + if 'pcm' in request.host or ('rama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rama' not in request.host and 'pcm' not in request.host): user = get_user(username) if not user: abort(404) @@ -116,7 +116,7 @@ def club_ban(v, username): @limiter.limit("1/second") @admin_level_required(6) def make_admin(v, username): - if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host): + if 'pcm' in request.host or ('rama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rama' not in request.host and 'pcm' not in request.host): user = get_user(username) if not user: abort(404) user.admin_level = 6 @@ -129,7 +129,7 @@ def make_admin(v, username): @limiter.limit("1/second") @admin_level_required(6) def remove_admin(v, username): - if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host): + if 'pcm' in request.host or ('rama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rama' not in request.host and 'pcm' not in request.host): user = get_user(username) if not user: abort(404) user.admin_level = 0 @@ -142,7 +142,7 @@ def remove_admin(v, username): @limiter.limit("1/second") @admin_level_required(6) def make_fake_admin(v, username): - if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host): + if 'pcm' in request.host or ('rama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rama' not in request.host and 'pcm' not in request.host): user = get_user(username) if not user: abort(404) user.admin_level = 1 @@ -155,7 +155,7 @@ def make_fake_admin(v, username): @limiter.limit("1/second") @admin_level_required(6) def remove_fake_admin(v, username): - if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host): + if 'pcm' in request.host or ('rama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rama' not in request.host and 'pcm' not in request.host): user = get_user(username) if not user: abort(404) user.admin_level = 0 @@ -168,7 +168,7 @@ def remove_fake_admin(v, username): @limiter.limit("1/day") @admin_level_required(6) def monthly(v): - if 'pcm' in request.host or ('rdrama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rdrama' not in request.host and 'pcm' not in request.host): + if 'pcm' in request.host or ('rama' in request.host and v.id in [1,12,28,29,747,995,1480]) or ('rama' not in request.host and 'pcm' not in request.host): thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id for u in g.db.query(User).options(lazyload('*')).filter(User.patron > 0).all(): grant_awards = {} diff --git a/files/routes/comments.py b/files/routes/comments.py index 0c298c460..77245dbb8 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -42,7 +42,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None): if not pid: if comment.parent_submission: pid = comment.parent_submission - elif "rdrama" in request.host: pid = 6489 + elif "rama" in request.host: pid = 6489 elif 'pcmemes.net' in request.host: pid = 382 else: pid = 1 @@ -307,7 +307,7 @@ def api_comment(v): g.db.add(n) - if "rdrama" in request.host and "ivermectin" in c.body.lower(): + if "rama" in request.host and "ivermectin" in c.body.lower(): c.is_banned = True c.ban_reason = "ToS Violation" @@ -384,7 +384,7 @@ def api_comment(v): c.upvotes += 1 g.db.add(c) - if "rdrama" in request.host and len(body) >= 1000 and v.username != "Snappy" and "" not in body_html: + if "rama" in request.host and len(body) >= 1000 and v.username != "Snappy" and "" not in body_html: body = random.choice(LONGPOST_REPLIES) body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) @@ -416,7 +416,7 @@ def api_comment(v): - if "rdrama" in request.host and random.random() < 0.001 and v.username != "Snappy" and v.username != "zozbot": + if "rama" in request.host and random.random() < 0.001 and v.username != "Snappy" and v.username != "zozbot": body = "zoz" body_md = CustomRenderer().render(mistletoe.Document(body)) @@ -657,7 +657,7 @@ def edit_comment(cid, v): c.body = body[:10000] c.body_html = body_html - if "rdrama" in request.host and "ivermectin" in c.body_html.lower(): + if "rama" in request.host and "ivermectin" in c.body_html.lower(): c.is_banned = True c.ban_reason = "ToS Violation" diff --git a/files/routes/discord.py b/files/routes/discord.py index a70f255d9..eea2f57e2 100644 --- a/files/routes/discord.py +++ b/files/routes/discord.py @@ -18,7 +18,7 @@ def join_discord(v): if v.is_suspended != 0: return "You're banned" - if 'rdrama' in request.host and v.admin_level == 0 and v.patron == 0 and v.truecoins < 150: return f"You must earn 150 {COINS_NAME} before entering the Discord server. You earn {COINS_NAME} by making posts/comments and getting upvoted." + if 'rama' in request.host and v.admin_level == 0 and v.patron == 0 and v.truecoins < 150: return f"You must earn 150 {COINS_NAME} before entering the Discord server. You earn {COINS_NAME} by making posts/comments and getting upvoted." if v.shadowbanned or v.agendaposter: return "" diff --git a/files/routes/front.py b/files/routes/front.py index e5ec38601..6650a6799 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -154,7 +154,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=' posts = g.db.query(Submission.id).options(lazyload('*')) - if 'rdrama' in request.host and sort == "hot": + if 'rama' in request.host and sort == "hot": cutoff = int(time.time()) - 86400 posts = posts.filter(Submission.created_utc >= cutoff) elif t != 'all': diff --git a/files/routes/login.py b/files/routes/login.py index 1bcd8ae2e..60e5606e5 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -348,7 +348,7 @@ def sign_up_post(v): if email: send_verification_email(new_user) - if "rdrama" in request.host: send_notification(NOTIFICATIONS_ACCOUNT, new_user, "Dude bussy lmao") + if "rama" in request.host: send_notification(NOTIFICATIONS_ACCOUNT, new_user, "Dude bussy lmao") session["user_id"] = new_user.id session["session_id"] = token_hex(16) diff --git a/files/routes/posts.py b/files/routes/posts.py index edf8a8cf9..e0152e4f1 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -227,7 +227,7 @@ def edit_post(pid, v): p.body = body p.body_html = body_html - if "rdrama" in request.host and "ivermectin" in body_html.lower(): + if "rama" in request.host and "ivermectin" in body_html.lower(): p.is_banned = True p.ban_reason = "ToS Violation" @@ -795,7 +795,7 @@ def submit_post(v): g.db.flush() - if "rdrama" in request.host and "ivermectin" in new_post.body_html.lower(): + if "rama" in request.host and "ivermectin" in new_post.body_html.lower(): new_post.is_banned = True new_post.ban_reason = "ToS Violation" @@ -865,11 +865,11 @@ def submit_post(v): n = Notification(comment_id=c_jannied.id, user_id=v.id) g.db.add(n) - if "rdrama" in request.host or (new_post.url and not "weebzone" in request.host and not "marsey.tech" in request.host): + if "rama" in request.host or (new_post.url and not "weebzone" in request.host and not "marsey.tech" in request.host): new_post.comment_count = 1 g.db.add(new_post) - if "rdrama" in request.host: + if "rama" in request.host: if v.id == 995: if random.random() < 0.02: body = "i love you carp" else: body = "fuck off carp" diff --git a/files/routes/settings.py b/files/routes/settings.py index f4c0b2ee0..c6e122ebf 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -288,7 +288,7 @@ def themecolor(v): @auth_required @validate_formkey def gumroad(v): - if 'rdrama' in request.host: patron = 'Paypig' + if 'rama' in request.host: patron = 'Paypig' else: patron = 'Patron' if not (v.email and v.is_activated): return {"error": f"You must have a verified email to verify {patron} status and claim your rewards"}, 400 diff --git a/files/templates/comments.html b/files/templates/comments.html index 7675af92f..1dd2f1f7b 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -235,7 +235,7 @@ {% if c.author.verified %} {% endif %} - {{c.author.username}} + {{c.author.username}} {% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %} {% if c.parent_comment_id and not standalone and level<=7 %}{{ c.parent_comment.author.username }}{% endif %} @@ -370,7 +370,7 @@ {% endif %} Context - Copy link + Copy link {% if v %} Report {% endif %} @@ -525,7 +525,7 @@ Unsave {% endif %} - Copy link + Copy link Context diff --git a/files/templates/default.html b/files/templates/default.html index 7eadc063d..1c671d586 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -266,10 +266,10 @@ - + {% if "marsey.tech" not in request.host and '@' not in request.path %} - + {% endif %} diff --git a/files/templates/errors/patron.html b/files/templates/errors/patron.html index 2fa38c45f..5b432d231 100644 --- a/files/templates/errors/patron.html +++ b/files/templates/errors/patron.html @@ -12,7 +12,7 @@

401 Not Authorized

-

This page is only available to {% if "rdrama" in request.host %}paypigs{% else %}patrons{% endif %}:

+

This page is only available to {% if "rama" in request.host %}paypigs{% else %}patrons{% endif %}:

{{'GUMROAD_LINK' | app_config}}
diff --git a/files/templates/header.html b/files/templates/header.html index 08914369e..9c2552df6 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -1,7 +1,7 @@