datatracker
datatracker copied to clipboard
Saving the "Upload agenda" page without selecting a file causes a server error
Describe the issue
From the "Upload agenda" page for a group session (meeting/<num>/session/<session_id>agenda
), clicking "Save" with the "Upload agenda" option selected causes a server error. The traceback is
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/workspace/ietf/meeting/views.py", line 2775, in upload_session_agenda
if form.is_valid():
File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 201, in is_valid
return self.is_bound and not self.errors
File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 196, in errors
self.full_clean()
File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 433, in full_clean
self._clean_fields()
File "/usr/local/lib/python3.9/site-packages/django/forms/forms.py", line 448, in _clean_fields
value = getattr(self, "clean_%s" % name)()
File "/workspace/ietf/meeting/views.py", line 2742, in clean_file
return super().clean_file()
File "/workspace/ietf/meeting/forms.py", line 415, in clean_file
validate_file_size(file)
File "/workspace/ietf/utils/validators.py", line 65, in validate_file_size
size = file.size
Exception Type: AttributeError at /meeting/119/session/32111/agenda
Exception Value: 'NoneType' object has no attribute 'size'
The user should get an error message - really, they shouldn't even be able to submit until the file is selected.
Code of Conduct
- [X] I agree to follow the IETF's Code of Conduct