divio/django-cms — pull request #1589 by evildmp (2013-01-15 15:01:05+00:00)
Title: delete_orphaned_plugins command

https://github.com/divio/django-cms/pull/1564 went a bit mad on one of the commits, so here's a new version of exactly the same thing.

Improves the cms list plugins command, and adds a new command to delete orphaned plugins.

Orphaned plugins are ones that exist in the CMSPlugins table, but:

have a plugin_type that is no longer even installed
have no corresponding saved instance in the table for that specific plugin
The second type is easy to create inadvertently: Insert a plugin in the admin, but don't save it. One of my databases had literally hundreds of these.

Includes tests and docs.