datatracker
datatracker copied to clipboard
upload_session_slides view is fragile and should be refactored
Describe the issue
The ietf.meeting.views.upload_session_slides()
view is fragile and should be refactored. It works by:
- Checking whether a
Document
already exists and either creating one or fetching the existing one and updating (but not saving) its title / rev - Updating
SessionPresentation
instances to include the doc from step 1 - Accepting the uploaded file
- Saving the
Document
from step 1, or returning an error
This means that a failed attempt to save the Document
in step 4 leaves inconsistent state in the SessionPresentation
instances - they refer to a rev that does not exist. It also might leave behind a Document
without contents.
This really should be refactored to create the Document
completely, then point at it if all went well.
Code of Conduct
- [X] I agree to follow the IETF's Code of Conduct