Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

content's PlaceholderField and related TextPlugin isn't deleted when an Article is removed #450

Open
sidneijp opened this issue Apr 4, 2017 · 0 comments

Comments

@sidneijp
Copy link

sidneijp commented Apr 4, 2017

The Article model has a content field of type PlaceholderField (internally it's a ForeignKey) that is used to receive at least the TextPlugin for the body of an article - the cms_wizards automatically add a TextPlugin if content is filled in the form, indeed.

But I realized that when you remove article(s) on the admin, it's not removing none of those, the placeholder used by the content field and its related plugins.

Try this:

  • Create an Article with content
  • Note the TextPlugin's id and the Placeholder's id of content field
  • Remove the article
  • Query for the plugin's id on CMSPlugin model - it'll still there
  • Query for the placeholder's id on Placeholder model - it'll still there

I think it's a problem because generates garbage - useless registers - on yout database.

Maybe it's actually a design issue on Django CMS's PlaceholderField that do not delete cascade by default.

@sidneijp sidneijp changed the title content's PlaceholderField and related TextPlugin isn't deleted when an Article is remove content's PlaceholderField and related TextPlugin isn't deleted when an Article is removed Apr 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant