ietf-tools / datatracker

The day-to-day front-end to the IETF database for people who work on IETF standards.
https://datatracker.ietf.org
BSD 3-Clause "New" or "Revised" License
565 stars 337 forks source link

Entering an agenda through the UI after uploading an html file does not work #7703

Closed jennifer-richards closed 3 weeks ago

jennifer-richards commented 1 month ago

Describe the issue

If the previous revision of a session's agenda was an uploaded HTML file, trying to revise it through the "Enter agenda" option at /meeting//session/agenda fails like

[17/Jul/2024 08:13:55] "GET /meeting/120/session/33286/agenda HTTP/1.0" 200 23940
ERROR: django.request:241: Internal Server Error: /meeting/120/session/33286/agenda
Traceback (most recent call last):
  File "/home/dev/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/dev/.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 2900, in upload_session_agenda
    save_error = handle_upload_file(file, filename, session.meeting, 'agenda', request=request, encoding=encoding)
  File "/workspace/ietf/meeting/utils.py", line 752, in handle_upload_file
    file.open()
AttributeError: '_io.BufferedReader' object has no attribute 'open'
ERROR: django.request:241: Internal Server Error: /meeting/120/session/33286/agenda
Traceback (most recent call last):
  File "/home/dev/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/dev/.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 2900, in upload_session_agenda
    save_error = handle_upload_file(file, filename, session.meeting, 'agenda', request=request, encoding=encoding)
  File "/workspace/ietf/meeting/utils.py", line 752, in handle_upload_file
    file.open()

As a workaround, writing the new agenda to a txt or md file and uploading it rather than entering it through the form allows the new version to post.

Code of Conduct

jennifer-richards commented 1 month ago

@flynnliz