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.

Commits

Files

    Loading...