emencia / cmsplugin-blocks

A set of DjangoCMS plugins for structured contents in CMS pages
https://cmspluginblocks.readthedocs.io/
MIT License
2 stars 0 forks source link

Deleting orphan image ? #5

Closed sveetch closed 1 year ago

sveetch commented 6 years ago

Django does not remove image files related to model objetcs since a long time (1.2) and so we can have some orphan media files when their related object has been deleted, even more since we have mass upload feature.

Since plugins keep a hided previous version object (for published/unpublished state), we can't directly remove these files from delete object/form method, so the last way is to have a commandline to delete orphan media files that only remove files that does not belong into any model objects (published or not).

sveetch commented 6 years ago

Since we use sorl-thumbnail in admin thumb and templates, we will need also to check about sorl cache store.

sveetch commented 1 year ago

Fixed in v1.0.0 (yet to be released).

Worth to notice that now image fields are manage with django-smart-media, currently it clean original uploaded file but has still to see for the sorl cache, it has an issue for this.