Add wagtail-periodic-review for content review scheduling#1742
Open
mwvolo wants to merge 1 commit into
Open
Conversation
Installs the wagtail-periodic-review package and wires PeriodicReviewMixin into GeneralPage, the four legal pages, and NewsArticle (blog posts) — the review panel, dashboard, and frequency settings now cover editorial content that genuinely needs periodic audits. RootPage/FlexPage are deliberately excluded: the package assumes every review-tracked model is a direct child of Page, but FlexPage is two MTI hops away (Page -> RootPage -> FlexPage). Since Python subclassing is transitive, putting the mixin on RootPage silently pulled FlexPage into that unsupported path and crashed the admin dashboard with a FieldError.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR integrates wagtail-periodic-review into OpenStax CMS to support scheduled content review in the Wagtail admin, enabling review metadata/panels on selected page types (General + legal pages + NewsArticle) while deliberately excluding RootPage/FlexPage to avoid the previously observed admin dashboard crash.
Changes:
- Add
wagtail-periodic-review==0.5.0and enablewagtail_periodic_reviewinINSTALLED_APPS. - Apply
PeriodicReviewMixinand add periodic-review panels to Settings forGeneralPage, legal pages, andNewsArticle. - Add migrations to persist periodic review fields (
last_review_date, version metadata, computednext_review_date, etc.) on the affected models.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements/base.txt | Adds the wagtail-periodic-review dependency pin. |
| openstax/settings/base.py | Registers wagtail_periodic_review in INSTALLED_APPS. |
| pages/models/core.py | Enables periodic review for GeneralPage and exposes review panels in Settings. |
| pages/models/legal.py | Enables periodic review for legal pages and exposes review panels in Settings. |
| pages/migrations/0195_accessibility_current_version_compiled_by_and_more.py | Adds periodic review fields to affected pages models. |
| news/models.py | Enables periodic review for NewsArticle and exposes review panels in Settings. |
| news/migrations/0058_newsarticle_current_version_compiled_by_and_more.py | Adds periodic review fields to NewsArticle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| wagtail-color-panel>=1.8.1,<1.9.0 | ||
| wagtail-html-editor==1.0.1 | ||
| wagtail-modeladmin==2.4.0 | ||
| wagtail-periodic-review==0.5.0 |
|
|
||
|
|
||
| class GeneralPage(FrontendPreviewMixin, Page): | ||
| class GeneralPage(FrontendPreviewMixin, PeriodicReviewMixin, Page): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wagtail-periodic-review(0.5.0) — adds a "Periodic review" settings panel, an admin dashboard (overdue / due-this-month), a content report, and per-content-type review frequency settings.PeriodicReviewMixinintoGeneralPage, the four legal pages (TermsOfService,Accessibility,Licensing,PrivacyPolicy), andNewsArticle(blog posts).RootPage/FlexPageare deliberately not included — see caveat below.Why RootPage/FlexPage are excluded
The package assumes every review-tracked page type is a direct child of
wagtail.models.Page.FlexPageis actually two levels deep (Page → RootPage → FlexPage). Since Python subclassing is transitive, adding the mixin toRootPageautomatically madeFlexPage"review-tracked" too, which crashed the admin home dashboard withFieldError: Cannot resolve keyword 'flexpage' into field(the package tries to queryPage.objects.annotate(flexpage__...), butPageonly has arootpagereverse accessor, notflexpage). Confirmed viarunserver+ an authenticated request before/after.Test plan
python manage.py check— cleanpython manage.py makemigrations --check --dry-run— no driftpages+newstest suites: 214/214 pass/admin/request returns 200 (dashboard no longer crashes)