Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a warning about signals in documentation #13

Closed
sveetch opened this issue May 20, 2023 · 1 comment
Closed

Add a warning about signals in documentation #13

sveetch opened this issue May 20, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@sveetch
Copy link
Owner

sveetch commented May 20, 2023

It has been proved at least the receiver auto_purge_files_on_delete connected on post_delete signal can be harmful when used with some very specific models.

This is especially the case with model from an application that may clone objects and delete original. As a example, there is a plugin from DjangoCMS, during publishing a page where a plugin has changed, the original plugin object from draft is cloned and original is removed.

The problem is that cloned object has copied the media paths but the original one is deleted so the auto_purge_files_on_delete delete its media since it don't know the media is still used from cloned object.

From implementation of auto_purge_files_on_delete it won't never been able to manage these specific case, developer should have to implement a new receiver which could manage it. But in the DjangoCMS plugin case, there is just not any argument passed to receiver that would allow to manage it well.

Signals should have a clear warning about these situation so developer could know about it possible problems before to add it into their applications.

@sveetch sveetch added the documentation Improvements or additions to documentation label May 20, 2023
@sveetch
Copy link
Owner Author

sveetch commented Aug 18, 2023

Done in 0.3.1-pre.2

@sveetch sveetch closed this as completed Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant