justquick / django-activity-stream

Generate generic activity streams from the actions on your site. Users can follow any actors' activities for personalized streams.
http://django-activity-stream.rtfd.io/en/latest/
BSD 3-Clause "New" or "Revised" License
2.36k stars 483 forks source link

[Feature proposal] Delete Follow objects when the followed object is deleted? #521

Closed David-Guillot closed 1 year ago

David-Guillot commented 1 year ago

Hi there,

In our use case we want to delete Follow objects when the followed object is deleted. We implemented that with Django pre_delete signal, and we thought that this piece of code was generic enough to maybe be integrated in actstream.

What do you think @justquick ? Maybe it could be conditioned to a setting if you don't want this behavior to be applied to everyone.

If you agree I can submit a PR today :wink:

justquick commented 1 year ago

yes that seems like a great idea thanks! i notice i have put on_delete=models.CASCADE, in the follow model's gfk but that's only tied to the django content type model since its a gfk. looks like i tried to do what you all did and didnt do it right. please send me a pr w/ that signal