Make MimetypeHandlers take care of deleting associated files for a file attachment.

Review Request #13141 — Created July 13, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

Currently we have no centralized method for deleting extra files associated
with file attachments, such as thumbnail files. This adds a
delete_associated_files method to the base MimetypeHandler class, which
can be implemented by subclasses to take care of deleting any extra associated
files that are created for file attachments of certain mimetypes. This also
updates the ImageMimetype class to delete the files it creates for thumbnails.

  • Tested in an upcoming change where deleting draft file attachments will
    trigger deleting all files associated with the draft.
  • Ran unit tests.

Diff Revision 3

This is not the most recent revision of the diff. The latest diff is revision 5. See what's changed.

orig
1
2
3
4
5

Commits

First Last Summary ID Author
Make MimetypeHandlers take care of deleting associated files.
5fb3e05b973ea6579baa617a247deba6b489bf58 Michelle Aubin
reviewboard/attachments/mimetypes.py
reviewboard/attachments/tests.py
Loading...