Skip to content

Commit

Permalink
Merge pull request #2294 from BirkbeckCTP/2284-bugfix
Browse files Browse the repository at this point in the history
Settings file to declare what settings should be merged
  • Loading branch information
mauromsl authored Mar 12, 2024
2 parents 5400054 + 56b5707 commit 88ba037
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion jenkins/janeway_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
INSTALLED_APPS= ["django_nose"]
INSTALLED_APPS = ["django_nose"]
MERGEABLE_SETTINGS = {"INSTALLED_APPS"}

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

Expand Down
2 changes: 2 additions & 0 deletions src/core/dev_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
'debug_toolbar',
'django_nose',
]


BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_DIR = os.path.dirname(BASE_DIR)

Expand Down
5 changes: 4 additions & 1 deletion src/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ def load_janeway_settings():
"Loading the following custom settings: %s" %(
custom_settings.keys(),
))
mergeable_settings = custom_settings.get(
"MERGEABLE_SETTINGS", MERGEABLE_SETTINGS,
)
for k, v in custom_settings.items():
if k in MERGEABLE_SETTINGS:
if k in mergeable_settings:
janeway_settings[k] = merge_settings(janeway_settings[k], v)
else:
janeway_settings[k] = v
Expand Down

0 comments on commit 88ba037

Please sign in to comment.