Skip to content

Add wagtail-periodic-review for content review scheduling#1742

Open
mwvolo wants to merge 1 commit into
mainfrom
add-wagtail-periodic-review
Open

Add wagtail-periodic-review for content review scheduling#1742
mwvolo wants to merge 1 commit into
mainfrom
add-wagtail-periodic-review

Conversation

@mwvolo

@mwvolo mwvolo commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Installs 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.
  • Wires PeriodicReviewMixin into GeneralPage, the four legal pages (TermsOfService, Accessibility, Licensing, PrivacyPolicy), and NewsArticle (blog posts).
  • RootPage/FlexPage are 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. FlexPage is actually two levels deep (Page → RootPage → FlexPage). Since Python subclassing is transitive, adding the mixin to RootPage automatically made FlexPage "review-tracked" too, which crashed the admin home dashboard with FieldError: Cannot resolve keyword 'flexpage' into field (the package tries to query Page.objects.annotate(flexpage__...), but Page only has a rootpage reverse accessor, not flexpage). Confirmed via runserver + an authenticated request before/after.

Test plan

  • python manage.py check — clean
  • python manage.py makemigrations --check --dry-run — no drift
  • Migrations apply cleanly on a fresh test DB from zero
  • pages + news test suites: 214/214 pass
  • Authenticated /admin/ request returns 200 (dashboard no longer crashes)
  • Manual: click through Settings tab on a legal page / GeneralPage / blog post, and the new "Periodic review frequency" site setting

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.
Copilot AI review requested due to automatic review settings July 15, 2026 02:40
@mwvolo mwvolo added the wip label Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.0 and enable wagtail_periodic_review in INSTALLED_APPS.
  • Apply PeriodicReviewMixin and add periodic-review panels to Settings for GeneralPage, legal pages, and NewsArticle.
  • Add migrations to persist periodic review fields (last_review_date, version metadata, computed next_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.

Comment thread requirements/base.txt
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
Comment thread pages/models/core.py


class GeneralPage(FrontendPreviewMixin, Page):
class GeneralPage(FrontendPreviewMixin, PeriodicReviewMixin, Page):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants