Arches is a web platform for creating, managing, & visualizing geospatial data. Arches was inspired by the needs of the Cultural Heritage community, particularly the widespread need of organizations to build & manage cultural heritage inventories
GNU Affero General Public License v3.0
210
stars
139
forks
source link
Reraise ImproperlyConfigured in SystemSettings #11118 #11119
[x] Bugfix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Description of Change
Protects against silent failure shown in issue
Issues Solved
Closes #11118
Checklist
I targeted one of these branches:
[x] dev/7.6.x (under development): features, bugfixes not covered below
[ ] dev/7.5.x (main support): regressions, crashing bugs, security issues, major bugs in new features
[ ] dev/6.2.x (extended support): major security issues, data loss issues
[x] I added a changelog in arches/releases
[ ] I submitted a PR to arches-docs (if appropriate)
[x] Unit tests pass locally with my changes
[x] I added tests that prove my fix is effective or that my feature works
[x] My test fails on the target branch
Ticket Background
Sponsored by: Getty Conservation Institute
Found by: @jacobtylerwalls
Testing considerations
A 'real life' scenario for testing:
Edit the if __name__ ... block of settings.py in core arches to include this (along the lines of #11009):
import django
from django.conf import global_settings, settings
settings_defined_here = {k: v for k, v in locals().items() if k.isupper()}
settings.configure(default_settings=global_settings, **settings_defined_here)
django.setup()
Then cd to the directory containing settings.py and attempt to python settings.py. With this change you should get a more appropriate failure instead of a red herring circular import error (emanating because we went to fetch from the database, which doesn't seem correct, and which won't necessarily always fail in future similar situations).
(Then, in #11016, we're going to address the underlying issue with the thumbnail factory by using django.conf settings, not ours)
Types of changes
Description of Change
Protects against silent failure shown in issue
Issues Solved
Closes #11118
Checklist
Ticket Background
Testing considerations
A 'real life' scenario for testing:
Edit the
if __name__ ...
block of settings.py in core arches to include this (along the lines of #11009):Then cd to the directory containing settings.py and attempt to
python settings.py
. With this change you should get a more appropriate failure instead of a red herring circular import error (emanating because we went to fetch from the database, which doesn't seem correct, and which won't necessarily always fail in future similar situations).(Then, in #11016, we're going to address the underlying issue with the thumbnail factory by using django.conf settings, not ours)