denshoproject / ddr-local

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

"'request' is not defined" when uploading mezzanine #325

Open gjost opened 1 year ago

gjost commented 1 year ago

On Fernow, using V5.6.1_HQMA, importing a mezz file to a new object got the following error (see attached). When I clicked back and backed up to the mezz file level, the pdf was importing, and in the time it took to write this message and gather all the documents it completed successfully. Created object. Moved files from PD to ddrshare. Went to mezz tab, selected add file, selected file ddr-densho-478-1_mezz_redacted.pdf, verified the fields, and pushed ok or whatever. And then I got the error

Environment:

Request Method: POST
Request URL: http://192.168.56.101/ui/file/ddr-densho-478-1-mezzanine/new/?path=/media/sf_ddrshared/ddr-densho-478-1_mezz_redacted.pdf

Django Version: 4.1.5
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',
 'namesdb_public')
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/webui/decorators.py", line 18, in wrapper
    return f(*args, **kwargs)
  File "/opt/ddr-local/ddrlocal/webui/views/decorators.py", line 18, in inner
    return func(request, *args, **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/files.py", line 179, in new
    check_parents(entity, collection, fetch=0)
  File "/opt/ddr-local/ddrlocal/webui/views/files.py", line 80, in check_parents
    request, WEBUI_MESSAGES['VIEWS_COLL_LOCKED'].format(collection.id)

Exception Type: NameError at /ui/file/ddr-densho-478-1-mezzanine/new/
Exception Value: name 'request' is not defined
GeoffFroh commented 1 year ago

Changed to fix-later since we haven't encountered this behavior since April.