denshoproject / ddr-local

Web UI used for interacting with DDR collections and entities on a local machine.
Other
3 stars 0 forks source link

Invalid organization ID crashes collections list page #308

Closed gjost closed 1 year ago

gjost commented 2 years ago
Environment:

Request Method: GET
Request URL: http://192.168.56.101/ui/collections/

Django Version: 4.0.4
Python Version: 3.9.2
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap_pagination',
 'gunicorn',
 'rest_framework',
 'sorl.thumbnail',
 'ddrlocal',
 'storage',
 'webui')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback (most recent call last):
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/ddr-local/ddrlocal/storage/decorators.py", line 83, in inner
    return func(request, *args, **kwargs)
  File "/opt/ddr-local/ddrlocal/webui/views/collections.py", line 60, in collections
    identifier = Identifier(object_id)
  File "/opt/ddr-local/ddrlocal/webui/identifier.py", line 43, in __init__
    super(Identifier, self).__init__(*args, **kwargs)
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/ddr_cmdln-5.4.4-py3.9.egg/DDR/identifier.py", line 946, in __init__
    if blargs['id']: self._from_id(blargs['id'], blargs['base_path'])
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/ddr_cmdln-5.4.4-py3.9.egg/DDR/identifier.py", line 976, in _from_id
    validate_idparts(self.id, self.idparts, VALID_COMPONENTS)
  File "/opt/ddr-local/venv/ddrlocal/lib/python3.9/site-packages/ddr_cmdln-5.4.4-py3.9.egg/DDR/identifier.py", line 551, in validate_idparts
    raise Exception(

Exception Type: Exception at /ui/collections/
Exception Value: Identifier: Invalid org "sjacl" in "ddr-sjacl" (see /opt/ddr-defs/repo_models/identifier.py).

Also crashes on ddr-qumulo fwiw

gjost commented 2 years ago

ANSWER: The org keywords just needed to be added to ddr-def:repo_models/identifier.py

gjost commented 2 years ago

Fixed in ddr-cmdln commit f57ea08 on develop branch and ddr-local commit 8645b82 on develop branch.