diff --git a/files/classes/comment.py b/files/classes/comment.py index feca324f6..271f728f6 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -90,7 +90,7 @@ class Comment(Base): @lazy def can_see(self, v): - if not SITE.startswith('rdrama.'): return True + if SITE != 'rdrama.net': return True if not self.parent_submission: return True if self.post.sub != 'chudrama': return True if v: diff --git a/files/classes/submission.py b/files/classes/submission.py index f4d8a8117..a1f2f65c6 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -80,7 +80,7 @@ class Submission(Base): @lazy def can_see(self, v): - if not SITE.startswith('rdrama.'): return True + if SITE != 'rdrama.net': return True if self.sub != 'chudrama': return True if v: if v.can_see_chudrama: return True diff --git a/files/helpers/const.py b/files/helpers/const.py index 5d3d4b72a..b70fda9f3 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -455,7 +455,7 @@ TIERS_ID_TO_NAME = { 6: "Rich Bich" } -if SITE.startswith('rdrama.'): +if SITE == 'rdrama.net': FEATURES['PRONOUNS'] = True FEATURES['HOUSES'] = True FEATURES['USERS_PERMANENT_WORD_FILTERS'] = True @@ -1379,7 +1379,7 @@ if len(SITE_NAME) > 5: if SITE != 'localhost': REDDIT_NOTIFS_SITE.add(SITE) -if SITE.startswith('rdrama.'): +if SITE == 'rdrama.net': REDDIT_NOTIFS_SITE.add('marsey') REDDIT_NOTIFS_SITE.add('"r/Drama"') REDDIT_NOTIFS_SITE.add('justice4darrell') diff --git a/files/helpers/stats.py b/files/helpers/stats.py index 9edafb85e..7828a6bbb 100644 --- a/files/helpers/stats.py +++ b/files/helpers/stats.py @@ -24,7 +24,7 @@ def chart(kind, site): now.tm_wday, now.tm_yday, 0)) today_cutoff = calendar.timegm(midnight_this_morning) - if SITE.startswith('rdrama.'): + if SITE == 'rdrama.net': time_diff = time.time() - 1619827200 num_of_weeks = int(time_diff / 604800) chart_width = int(num_of_weeks/1.4) diff --git a/files/routes/admin.py b/files/routes/admin.py index b5bf42ba8..99e17c8ca 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -159,7 +159,7 @@ def merge_all(v, id): @app.post("/@/make_admin") @admin_level_required(PERMS['ADMIN_ADD']) def make_admin(v, username): - if SITE.startswith('rdrama.'): abort(403) + if SITE == 'rdrama.net': abort(403) user = get_user(username) diff --git a/files/routes/awards.py b/files/routes/awards.py index 06b54b483..469f5f96d 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -158,7 +158,7 @@ def award_thing(v, thing_type, id): author = thing.author if author.shadowbanned: abort(404) - if SITE.startswith('rdrama.') and author.id in (PIZZASHILL_ID, CARP_ID): + if SITE == 'rdrama.net' and author.id in (PIZZASHILL_ID, CARP_ID): abort(403, "This user is immune to awards.") if kind == "benefactor" and author.id == v.id: diff --git a/files/routes/chat.py b/files/routes/chat.py index 61a478728..c68773d69 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -56,7 +56,7 @@ def speak(data, v): global messages, total - if SITE.startswith('rdrama.'): text = data['message'][:200].strip() + if SITE == 'rdrama.net': text = data['message'][:200].strip() else: text = data['message'][:1000].strip() if not text: return '', 403 diff --git a/files/routes/static.py b/files/routes/static.py index c1810aa99..105aa5973 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -22,7 +22,7 @@ def rdrama(id, title): @app.get("/marseys") @auth_required def marseys(v): - if SITE.startswith('rdrama.'): + if SITE == 'rdrama.net': marseys = g.db.query(Marsey, User).join(User, Marsey.author_id == User.id).filter(Marsey.submitter_id==None) sort = request.values.get("sort", "usage") if sort == "usage": @@ -52,7 +52,7 @@ def marsey_list(): if EMOJI_MARSEYS: emojis = [{ "name": emoji.name, - "author": author if SITE.startswith('rdrama.') or author == "anton-d" else None, + "author": author if SITE == 'rdrama.net' or author == "anton-d" else None, # yikes, I don't really like this DB schema. Next time be better "tags": emoji.tags.split(" ") + [emoji.name[len("marsey"):] \ if emoji.name.startswith("marsey") else emoji.name], diff --git a/files/routes/users.py b/files/routes/users.py index 02c71301f..e4aacb48d 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -433,7 +433,7 @@ def message2(v, username): body_html = sanitize(message) - if not (SITE.startswith('rdrama.') and user.id == BLACKJACKBTZ_ID): + if not (SITE == 'rdrama.net' and user.id == BLACKJACKBTZ_ID): existing = g.db.query(Comment.id).filter(Comment.author_id == v.id, Comment.sentto == user.id, Comment.body_html == body_html, diff --git a/files/templates/comments.html b/files/templates/comments.html index f853e5374..8f9e64431 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -404,7 +404,7 @@ Context - + {% if v %} {% if not c.deleted_utc %} @@ -618,7 +618,7 @@ Context - + {% if v %} diff --git a/files/templates/hats.html b/files/templates/hats.html index 35a7101be..9c42c83d4 100644 --- a/files/templates/hats.html +++ b/files/templates/hats.html @@ -84,7 +84,7 @@ Hat Name Description - {% if SITE.startswith('rdrama.') %} + {% if SITE == 'rdrama.net' %} {% if request.values.get("sort") == 'author_asc' %} Author {% else %} @@ -114,7 +114,7 @@ {{hat.name}} {{hat.censored_description(v)}} - {% if SITE.startswith('rdrama.') %} + {% if SITE == 'rdrama.net' %} {% include "user_in_table.html" %} {% endif %} {{hat.number_sold}} diff --git a/files/templates/html_head.html b/files/templates/html_head.html index 8ea6d4f5d..aa9bc1c69 100644 --- a/files/templates/html_head.html +++ b/files/templates/html_head.html @@ -35,7 +35,7 @@ {% endmacro %} {% macro cf_2fa_verify() %} - {% if SITE.startswith('rdrama.') %} + {% if SITE == 'rdrama.net' %} {% elif SITE == 'watchpeopledie.tv' %} diff --git a/files/templates/marseys.html b/files/templates/marseys.html index c5f98fee5..690d159ac 100644 --- a/files/templates/marseys.html +++ b/files/templates/marseys.html @@ -7,7 +7,7 @@ Name Marsey Usage - {% if SITE.startswith('rdrama.') %} + {% if SITE == 'rdrama.net' %} Author Added on Original File @@ -15,7 +15,7 @@ -{% if SITE.startswith('rdrama.') %} +{% if SITE == 'rdrama.net' %} {% for marsey, user in marseys %} {{loop.index}} diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index eac6893fd..db7cebea0 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -12,7 +12,7 @@ {% endif %} - + {% if v %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index 156541cb7..ba7db2eab 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -12,7 +12,7 @@ {% endif %} - +