diff --git a/files/__main__.py b/files/__main__.py index 1d294a661d..438c94c4e5 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -87,7 +87,7 @@ from files.routes.allroutes import * if app.config['SERVICE'] == Service.RDRAMA: from files.routes import * - if HOLIDAY_EVENT: + if HOLIDAY_EVENT(): from files.events import * event_init() elif app.config['SERVICE'] == Service.CHAT: diff --git a/files/classes/user.py b/files/classes/user.py index 327df84175..bdd8bcfef6 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -265,7 +265,7 @@ class User(Base): @lazy def hat_active(self, v): if FEATURES['HATS']: - if HOLIDAY_EVENT: + if HOLIDAY_EVENT(): from files.events.helpers.const import EVENT_FORCED_HATS if EVENT_FORCED_HATS: if SITE_NAME == 'rDrama': @@ -1080,7 +1080,7 @@ class User(Base): def shadowbanner(self): return g.db.query(User.username).filter_by(id=self.shadowbanned).one()[0] - if HOLIDAY_EVENT: + if HOLIDAY_EVENT(): @property @lazy def can_toggle_event_music(self): diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 235a430635..82df97106e 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -62,7 +62,7 @@ def execute_snappy(post:Submission, v:User): body = "Can you people come up with any ideas that don't involve committing federal crimes" else: if SNAPPY_MARSEYS and SNAPPY_QUOTES: - if HOLIDAY_EVENT or random.random() > 0.5: + if HOLIDAY_EVENT() or random.random() > 0.5: SNAPPY_CHOICES = SNAPPY_QUOTES else: SNAPPY_CHOICES = SNAPPY_MARSEYS diff --git a/files/helpers/assetcache.py b/files/helpers/assetcache.py index 0cf73c6b23..50e9f0c643 100644 --- a/files/helpers/assetcache.py +++ b/files/helpers/assetcache.py @@ -12,7 +12,7 @@ ASSET_SUBDIRS = ['/css', '/js', '/js/vendor'] ASSET_URL = '/assets/' ASSET_CACHE = defaultdict(lambda: None) -if HOLIDAY_EVENT: +if HOLIDAY_EVENT(): ASSET_SUBDIRS.extend(['/event/css', '/event/css/themes', '/event/js']) def assetcache_build(asset_dir, subdirs): diff --git a/files/helpers/const_stateful.py b/files/helpers/const_stateful.py index d8ed72d93e..6d5e9b074f 100644 --- a/files/helpers/const_stateful.py +++ b/files/helpers/const_stateful.py @@ -32,7 +32,7 @@ def _initialize_snappy_marseys_and_quotes(): SNAPPY_MARSEYS = [f':#{x}:' for x in marseys_const2] filename = f"snappy_{SITE_NAME}.txt" - if HOLIDAY_EVENT: filename = f"snappy_event_{SITE_NAME}.txt" + if HOLIDAY_EVENT(): filename = f"snappy_event_{SITE_NAME}.txt" try: with open(filename, "r", encoding="utf-8") as f: diff --git a/files/routes/awards.py b/files/routes/awards.py index 613559e74b..31935dc83d 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -406,7 +406,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 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) diff --git a/files/routes/votes.py b/files/routes/votes.py index fb3de48932..e480f0233e 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -88,7 +88,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): abort(400) existing = existing.one_or_none() - if HOLIDAY_EVENT: + if HOLIDAY_EVENT(): coin_mult = 2 coin_value = coin_delta * coin_mult diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index 37383435fe..fac434068e 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -47,7 +47,7 @@ def get_logged_in_user(): abort(403) g.v = v - if HOLIDAY_EVENT: + if HOLIDAY_EVENT(): from files.events.helpers.get import get_or_create_event_user g.event_v = get_or_create_event_user(v, g.db) diff --git a/files/templates/default.html b/files/templates/default.html index b90c93cdb6..602c2479c3 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -4,7 +4,7 @@ {% block banner %} {% include "modals/expanded_image.html" %} {% if err or '@' not in request.path %} - {% if HOLIDAY_EVENT and not sub %} + {% if HOLIDAY_EVENT() and not sub %} {% include 'event/banner.html' %} {% else %} {% if err and SITE_NAME == 'rDrama' %} @@ -79,7 +79,7 @@ {% endif %} -{% if HOLIDAY_EVENT %} +{% if HOLIDAY_EVENT() %} {% include "event/music.html" %} {% endif %} diff --git a/files/templates/header.html b/files/templates/header.html index e5fad761ac..31dbf77bdc 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -61,7 +61,7 @@ {% elif has_logo %}
- {% if SITE_NAME == 'WPD' and HOLIDAY_EVENT %} + {% if SITE_NAME == 'WPD' and HOLIDAY_EVENT() %} {% else %} diff --git a/files/templates/root.html b/files/templates/root.html index 5868f48b1b..c2a3eda207 100644 --- a/files/templates/root.html +++ b/files/templates/root.html @@ -12,7 +12,7 @@ - + {% block head %} diff --git a/files/templates/sidebar_WPD.html b/files/templates/sidebar_WPD.html index 9126bd0c4d..f94ddb33af 100644 --- a/files/templates/sidebar_WPD.html +++ b/files/templates/sidebar_WPD.html @@ -31,7 +31,7 @@ - {% if HOLIDAY_EVENT %} + {% if HOLIDAY_EVENT() %} {% endif %}

@@ -86,6 +86,6 @@
-{% if HOLIDAY_EVENT %} +{% if HOLIDAY_EVENT() %} {% endif %} diff --git a/files/templates/sidebar_rDrama.html b/files/templates/sidebar_rDrama.html index 980b67c39b..aa8ae49cc2 100644 --- a/files/templates/sidebar_rDrama.html +++ b/files/templates/sidebar_rDrama.html @@ -2,7 +2,7 @@ {% if sub %} {% set image=sub.sidebar_url %} - {% elif HOLIDAY_EVENT %} + {% elif HOLIDAY_EVENT() %} {% set image = macros.random_image("assets/event/images/sidebar") %} {% else %} {% set image = macros.random_image("assets/images/" ~ SITE_NAME ~ "/sidebar") %} @@ -40,7 +40,7 @@ - {% if HOLIDAY_EVENT %} + {% if HOLIDAY_EVENT() %} {% endif %}

@@ -78,6 +78,6 @@ {% endif %} -{% if HOLIDAY_EVENT %} +{% if HOLIDAY_EVENT() %} {% endif %} diff --git a/files/templates/userpage/userpage.html b/files/templates/userpage/userpage.html index 336a114d66..de8f389797 100644 --- a/files/templates/userpage/userpage.html +++ b/files/templates/userpage/userpage.html @@ -28,7 +28,7 @@
{{u.username}}
{% endif %} -{% if not HOLIDAY_EVENT or SITE_NAME == 'WPD' %} +{% if not HOLIDAY_EVENT() or SITE_NAME == 'WPD' %} {% endif %} {% endblock %}