Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set initial CSP_EXCLUDE_URL_PREFIXES value in base.py #247

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

SonnyBA
Copy link
Contributor

@SonnyBA SonnyBA commented Sep 17, 2024

Fixes the CSP_EXCLUDE_URL_PREFIXES not being set properly.

Encountered when running makemigrations:

Traceback (most recent call last):
  File "/home/sonny/development/open-klant/./src/manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/home/sonny/development/open-klant/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/home/sonny/development/open-klant/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 382, in execute
    settings.INSTALLED_APPS
  File "/home/sonny/development/open-klant/env/lib/python3.11/site-packages/django/conf/__init__.py", line 102, in __getattr__
    self._setup(name)
  File "/home/sonny/development/open-klant/env/lib/python3.11/site-packages/django/conf/__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sonny/development/open-klant/env/lib/python3.11/site-packages/django/conf/__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/sonny/development/open-klant/src/openklant/conf/dev.py", line 24, in <module>
    from .base import *  # noqa isort:skip
    ^^^^^^^^^^^^^^^^^^^
  File "/home/sonny/development/open-klant/src/openklant/conf/base.py", line 51, in <module>
    CSP_EXCLUDE_URL_PREFIXES += (
    ^^^^^^^^^^^^^^^^^^^^^^^^
NameError: name 'CSP_EXCLUDE_URL_PREFIXES' is not defined

@SonnyBA SonnyBA added the bug Something isn't working label Sep 17, 2024
@SonnyBA SonnyBA requested a review from Coperh September 17, 2024 09:39
@SonnyBA SonnyBA self-assigned this Sep 17, 2024
Copy link
Contributor

@Coperh Coperh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why it is not being defined in OAF but it is going to be removed anyway

@SonnyBA SonnyBA merged commit b18da87 into master Sep 17, 2024
14 checks passed
@SonnyBA SonnyBA deleted the update-base-settings branch September 17, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants