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

Deleting an Initiative/user should also delete its associated social links #69

Open
dulldesk opened this issue Oct 26, 2020 · 3 comments

Comments

@dulldesk
Copy link
Contributor

dulldesk commented Oct 26, 2020

May need to come after #70 is implemented

@dulldesk dulldesk changed the title Deleting an Initiative should also delete its associated social links Deleting an Initiative/user should also delete its associated social links Oct 26, 2020
@fluix-dev
Copy link
Collaborator

fluix-dev commented Oct 26, 2020

Shouldn't need to come after #70, that will touch the SocialLink, while this only affects the SocialLinkAttachement.

@dulldesk dulldesk self-assigned this Nov 25, 2020
@dulldesk
Copy link
Contributor Author

dulldesk commented Jan 4, 2021

This is probably relevant

Unlike ForeignKey, GenericForeignKey does not accept an on_delete argument to customize this behavior; if desired, you can avoid the cascade-deletion by not using GenericRelation, and alternate behavior can be provided via the pre_delete signal.

source

@fluix-dev
Copy link
Collaborator

So the solution (it seems, though not explicitly stated in the docs) is either using GenericRelation or pre_delete. GenericRelation might actually be quite handy for simplifying our SocialLinkAttachment queries.

@dulldesk dulldesk removed their assignment Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants