From 0900b883b6439fa89ac1ff3430e7f36dd561b2bf Mon Sep 17 00:00:00 2001 From: Snakes Date: Tue, 29 Nov 2022 14:53:12 -0500 Subject: [PATCH] Stylistic choices + preparing for multi-event. --- files/__main__.py | 9 ++++----- files/helpers/const.py | 3 ++- files/routes/awards.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index 1b9b85ba4..265a15b56 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -82,12 +82,11 @@ def no_step_on_jc(): if app.config['SERVICE'] == Service.RDRAMA: from files.routes import * + + if HOLIDAY_EVENT: + from files.events import * + event_init() elif app.config['SERVICE'] == Service.CHAT: from files.routes.chat import * -if FEATURES['HOLIDAY_EVENT']: - if app.config['SERVICE'] == Service.RDRAMA: - from files.events import * - event_init() - stdout.flush() diff --git a/files/helpers/const.py b/files/helpers/const.py index c89f33770..edec3416e 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -209,6 +209,8 @@ PAGE_SIZES = {10, 25, 50, 100} ### SITE SPECIFIC CONSTANTS ################################################################################ +HOLIDAY_EVENT = 'homoween22' + PERMS = { # Minimum admin_level to perform action. 'ADMIN_ADD': 3, 'ADMIN_REMOVE': 3, @@ -309,7 +311,6 @@ FEATURES = { 'PATRON_ICONS': False, 'ASSET_SUBMISSIONS': False, 'STREAMERS': False, - 'HOLIDAY_EVENT': True, } WERKZEUG_ERROR_DESCRIPTIONS = { diff --git a/files/routes/awards.py b/files/routes/awards.py index dda6b15d7..5106ef8e7 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -390,7 +390,7 @@ def award_thing(v, thing_type, id): if author.spider: author.spider += 86400 else: author.spider = int(time.time()) + 86400 badge_grant(user=author, badge_id=179, notify=False) - elif FEATURES['HOLIDAY_EVENT']: + elif HOLIDAY_EVENT: from files.events import EVENT_AWARDS, award_thing_event if kind in EVENT_AWARDS: award_thing_event(v, kind, author)