Skip to content

[BUG] Accessing the API root as unauthenticated user raises internal server error #3650

@johannaengland

Description

@johannaengland

Describe the bug

When accessing /api as an unauthenticated user it leads to the following internal server error:

Internal Server Error: /api/
Traceback (most recent call last):
  File "/home/vscode/.venv/lib/python3.11/site-packages/django/utils/module_loading.py", line 30, in import_string
    return cached_import(module_path, class_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.venv/lib/python3.11/site-packages/django/utils/module_loading.py", line 16, in cached_import
    return getattr(module, class_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'nav.django.utils' has no attribute 'default_account'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/vscode/.venv/lib/python3.11/site-packages/rest_framework/settings.py", line 179, in import_from_string
    return import_string(val)
           ^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.venv/lib/python3.11/site-packages/django/utils/module_loading.py", line 32, in import_string
    raise ImportError(
ImportError: Module "nav.django.utils" does not define a "default_account" attribute/class

Environment (please complete the following information):

  • NAV version installed: 5.15.0

Additional context

This was introduced in NAV 5.15.0, 5.14.1 does not raise the same error.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions