unikent / programmes-plant

A comprehensive solution for the management of university programmes, that produces an XCRI feed.
Other
7 stars 4 forks source link

Override delete() in Image to soft-delete the actual image files. #969

Closed sy238-unikent closed 5 years ago

sy238-unikent commented 5 years ago

When an image was deleted only the database record was set to hidden - the actual files were left where they were.

This meant that if the URLs were known (e.g. google cache / image search) then the images could still be displayed.

This fix prefixes the image and thumbnail filenames with a '.' when images are deleted, so that the old URLs no longer work.

We could actually delete the image files, but as "deleting" only hides the database records it makes more sense to hide the files so we can retrieve them if need be.

To test,