From e5dc7a82a7a3fd542d8af453eb5397f7b0f014fd Mon Sep 17 00:00:00 2001 From: hklarner Date: Mon, 18 Sep 2023 19:48:36 +0200 Subject: [PATCH] settings/dev: bugfix local.py should override any other settings --- adhocracy-plus/config/settings/dev.py | 39 +++++++++++++++------------ 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/adhocracy-plus/config/settings/dev.py b/adhocracy-plus/config/settings/dev.py index b0d1be6e27..4e2a8cf7dd 100644 --- a/adhocracy-plus/config/settings/dev.py +++ b/adhocracy-plus/config/settings/dev.py @@ -19,23 +19,6 @@ INTERNAL_IPS = ("127.0.0.1", "localhost") -try: - from .local import * -except ImportError: - pass - -try: - INSTALLED_APPS += tuple(ADDITIONAL_APPS) -except NameError: - pass - -try: - CKEDITOR_CONFIGS["collapsible-image-editor"]["embed_provider"] = CKEDITOR_URL - CKEDITOR_CONFIGS["video-editor"]["embed_provider"] = CKEDITOR_URL -except NameError: - pass - - WAGTAILADMIN_BASE_URL = "http://localhost:8004" CAPTCHA_URL = "https://captcheck.netsyms.com/api.php" SITE_ID = 1 @@ -54,3 +37,25 @@ } CELERY_TASK_ALWAYS_EAGER = True + +# The local.py import happen at the end of this file so that it can overwrite +# any defaults in dev.py. +# Special cases are: +# 1) ADDITIONAL_APPS in local.py should be appended to INSTALLED_APPS. +# 2) CKEDITOR_URL should be inserted into CKEDITOR_CONFIGS in the correct location. + +try: + from .local import * +except ImportError: + pass + +try: + INSTALLED_APPS += tuple(ADDITIONAL_APPS) +except NameError: + pass + +try: + CKEDITOR_CONFIGS["collapsible-image-editor"]["embed_provider"] = CKEDITOR_URL + CKEDITOR_CONFIGS["video-editor"]["embed_provider"] = CKEDITOR_URL +except NameError: + pass