From f13f7d238ccb6d1936ce98b86153abb535cc2675 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 27 Sep 2020 18:02:23 +0200 Subject: [PATCH] still load config --- pandora/app/config.py | 13 ++++++++++++- pandora/app/monkey_patch.py | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pandora/app/config.py b/pandora/app/config.py index 631204f1..3e96ac27 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -254,7 +254,6 @@ check the README for further details. except: pass - def update_static(): oxjs_build = os.path.join(settings.STATIC_ROOT, 'oxjs/tools/build/build.py') if os.path.exists(oxjs_build): @@ -364,3 +363,15 @@ def update_geoip(force=False): else: print('failed to download GeoLite2-City.mmdb') +def init(): + load_config(True) + +def shutdown(): + if settings.RELOADER_RUNNING: + RUN_RELOADER = False + settings.RELOADER_RUNNING = False + if NOTIFIER: + NOTIFIER.stop() + + + diff --git a/pandora/app/monkey_patch.py b/pandora/app/monkey_patch.py index 0bf0212d..f4579d56 100644 --- a/pandora/app/monkey_patch.py +++ b/pandora/app/monkey_patch.py @@ -7,7 +7,9 @@ from django.core.validators import MaxLengthValidator User = get_user_model() +# load config from json from . import config +config.init() NEW_LENGTH = { 'username': 255,