Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Improve handling of orphaned Placeholder objects remaining after project template changes #80

Open
cogat opened this issue Nov 3, 2016 · 0 comments

Comments

@cogat
Copy link
Contributor

cogat commented Nov 3, 2016

From: https://app.assembla.com/spaces/sfmoma/tickets/1584-improve-handling-of-orphaned-placeholder-objects-remaining-after-project-template-changes/details

In #1582 and #354 issues have been reported where CMS admin form submissions fail with 500 server errors, where these errors are caused by missing Placeholder objects for existing content when their related project templates have changed. See Tai's comment https://www.assembla.com/spaces/sfmoma/tickets/354/details?comment=828471793 and an upstream pull request for Fluent django-fluent/django-fluent-contents#63

Look into improving our handling of new/changed/orphaned Placeholder objects for existing content by:
detecting problems and displaying them in the admin so they can be fixed manually
running the existing cleanup_fluent_placeholders management command regularly on production to work around problems and avoid the 500 server errors.

Notes from @TaiLee :

If the template has changed, those pages already might have "orphaned" content (if a placeholder was removed/renamed)... if a placeholder was added, the pages will still render OK but CMS users won't be able to save them... Perhaps until this problem is properly fixed in fluent, we should make a StalePlaceholders model, and update our management command to create a StalePlaceholders object with an GFK to the affected object, and either send a notification and/or expose a list of objects with stale placeholders in the admin, so CMS users can find and fix them?

Maybe run cleanup_fluent_placeholders it once a week, or once daily? but it would be good to at least get an email notification when changes are made, with links to the affected objects... otherwise the admin form will be fixed at least, but users wont know that pages potentially have orphaned content

addyyeow has set up a celery/cron job to run the cleanup command every night at midnight (see #1582) which works around the admin errors issue for now. But this work-around doesn't solve the second part of this ticket, which is exposing orphaned or otherwise problematic Placeholders to admins so they can correct things manually.

-- Can we not run cleanup once per deployment/runserver?

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