Internal Server Error: /elr/repository/manager/3/edit/metadata/
Traceback (most recent call last):
File "/home/joemull/git/janedb/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/home/joemull/git/janedb/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/joemull/git/janedb/src/security/decorators.py", line 72, in wrapper
return func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/joemull/git/janedb/src/security/decorators.py", line 1245, in wrapper
return func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/joemull/git/janedb/src/repository/views.py", line 1027, in repository_edit_metadata
metadata_form = forms.PreprintInfo(
^^^^^^^^^^^^^^^^^^^
File "/home/joemull/git/janedb/src/repository/forms.py", line 63, in __init__
self.fields['submission_agreement'].initial = True
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'submission_agreement'
Describe the bug
There is a chance of a KeyError here:
janeway/src/repository/forms.py
Lines 62 to 63 in 78298b2
Janeway version
1.7.0
Proposed solution
Check for the existence of the field, as it could have been popped off right above.