From 8c809d2de42ecac03f4081c35bc541e67b4ca02b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 7 Jan 2022 23:44:38 +0200 Subject: [PATCH] sfd --- files/helpers/const.py | 5 ++++- files/routes/admin.py | 2 +- files/routes/comments.py | 2 +- files/routes/posts.py | 4 ++-- files/routes/settings.py | 2 +- files/templates/admin/awards.html | 2 +- files/templates/comments.html | 2 +- files/templates/emoji_modal.html | 2 +- files/templates/marseys.html | 2 +- files/templates/settings_profile.html | 2 +- files/templates/submission.html | 2 +- files/templates/submission_listing.html | 2 +- files/templates/userpage_private.html | 2 +- 13 files changed, 17 insertions(+), 14 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index efe18da36..8d4d40d11 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -158,6 +158,7 @@ if SITE == 'rdrama.net': IDIO_ID = 30 CARP_ID = 995 JOAN_ID = 28 + MOOSE_ID = 1904 AEVANN_ID = 1 LAWLZ_ID = 3833 LLM_ID = 253 @@ -183,6 +184,7 @@ elif SITE == "pcmemes.net": IDIO_ID = 0 CARP_ID = 0 JOAN_ID = 0 + MOOSE_ID = 0 AEVANN_ID = 1 LAWLZ_ID = 0 LLM_ID = 0 @@ -208,6 +210,7 @@ else: IDIO_ID = 0 CARP_ID = 0 JOAN_ID = 0 + MOOSE_ID = 0 AEVANN_ID = 0 LAWLZ_ID = 0 LLM_ID = 0 @@ -769,4 +772,4 @@ NOTIFIED_USERS = { 'kippy': KIPPY_ID, } -num_banners = len(listdir('files/assets/images/Drama/banners')) + 1 +num_banners = len(listdir('files/assets/images/Drama/banners')) + 1 \ No newline at end of file diff --git a/files/routes/admin.py b/files/routes/admin.py index 01271102a..b54172231 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -205,7 +205,7 @@ def remove_meme_admin(v, username): @admin_level_required(3) @validate_formkey def monthly(v): - if request.host == 'rdrama.net' and v.id != 1: abort (403) + if request.host == 'rdrama.net' and v.id != AEVANN_ID: abort (403) thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id diff --git a/files/routes/comments.py b/files/routes/comments.py index 3b0966b0c..9332a7fb6 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -286,7 +286,7 @@ def api_comment(v): parent_comment_id=parent_comment_id, top_comment_id=top_comment_id, level=level, - over_18=request.host == 'pcmemes.net' and v.id == 1578 or parent_post.over_18 or request.values.get("over_18","")=="true", + over_18=parent_post.over_18 or request.values.get("over_18","")=="true", is_bot=is_bot, app_id=v.client.application.id if v.client else None, body_html=body_html, diff --git a/files/routes/posts.py b/files/routes/posts.py index 1c23514db..05a2dcea3 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -197,7 +197,7 @@ def post_id(pid, anything=None, v=None): offset = 0 - if not request.headers.get("Authorization") and post.comment_count > 60 and not (v and v.id == 1): + if not request.headers.get("Authorization") and post.comment_count > 60: comments2 = [] count = 0 if post.created_utc > 1638672040: @@ -951,7 +951,7 @@ def submit_post(v): private=bool(request.values.get("private","")), club=club, author_id=v.id, - over_18=request.host == 'pcmemes.net' and v.id == 1578 or bool(request.values.get("over_18","")), + over_18=bool(request.values.get("over_18","")), app_id=v.client.application.id if v.client else None, is_bot = request.headers.get("Authorization"), url=url, diff --git a/files/routes/settings.py b/files/routes/settings.py index c92db4469..be1651fb9 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -162,7 +162,7 @@ def settings_profile_post(v): else: template = 'CHRISTMAS/' return render_template(f"{template}settings_profile.html", v=v, msg="Your enemies list has been updated.") - elif (v.patron or v.id == 1904) and request.values.get("sig"): + elif (v.patron or v.id == MOOSE_ID) and request.values.get("sig"): sig = request.values.get("sig")[:200] for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', sig, re.MULTILINE): diff --git a/files/templates/admin/awards.html b/files/templates/admin/awards.html index ac23794fc..125082144 100644 --- a/files/templates/admin/awards.html +++ b/files/templates/admin/awards.html @@ -63,7 +63,7 @@

-	{% if request.host != 'rdrama.net' or v.id == 1 %}
+	{% if request.host != 'rdrama.net' or v.id == AEVANN_ID %}
 		
Grant Monthly Marseybux
{% endif %} {% endblock %} \ No newline at end of file diff --git a/files/templates/comments.html b/files/templates/comments.html index fc639ed1f..4ca5964c0 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -245,7 +245,7 @@ {{c.options_html(v) | safe}} {% endif %} - {% if c.author.sig_html and (c.author_id == 1904 or not (v and v.sigs_disabled)) %} + {% if c.author.sig_html and (c.author_id == MOOSE_ID or not (v and v.sigs_disabled)) %}
{{c.author.sig_html | safe}} {% endif %} diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 5683a7b4b..b7ccffa69 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -80,7 +80,7 @@ - +