Page MenuHomeSoftware Heritage

settings/common: Move OIDC_SWH_WEB_CLIENT_ID variable to auth.utils

Authored by anlambert on Mon, Mar 23, 4:40 PM.



Without that small change, overall swh Sphinx doc fails to build with the following error:

WARNING: autodoc: failed to import module 'backends' from module 'swh.web.auth'; the following exception was raised:
Traceback (most recent call last):
  File "/home/jenkins/workspace/DDOC/dev/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/sphinx/ext/autodoc/", line 32, in import_module
    return importlib.import_module(modname)
  File "/usr/lib/python3.7/importlib/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/jenkins/workspace/DDOC/dev/swh-web/swh/web/auth/", line 24, in <module>
    _oidc_client: KeycloakOpenIDConnect = get_oidc_client()
  File "/home/jenkins/workspace/DDOC/dev/swh-web/swh/web/auth/", line 58, in get_oidc_client
    client_id = settings.OIDC_SWH_WEB_CLIENT_ID
  File "/home/jenkins/workspace/DDOC/dev/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/django/conf/", line 57, in __getattr__
    val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'OIDC_SWH_WEB_CLIENT_ID'

Diff Detail

rDWAPPS Web applications
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.