Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies = [
"user-agents==2.2.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The after_publish_page hook uses get_edit_handler(), a method removed in Wagtail 6.0, which will cause an AttributeError when publishing pages.
Severity: CRITICAL

Suggested Fix

Refactor the hook in cms/wagtail_hooks.py to stop using the deprecated get_edit_handler(). Instead, use the modern Wagtail API to get the form class. The relevant page models already define a base_form_class, which can likely be used directly, for example: form_class = page.specific_class.base_form_class.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: pyproject.toml#L57

Potential issue: The upgrade to Wagtail 6.3.6 likely removes the `get_edit_handler()`
method, which was deprecated and scheduled for removal. This method is still used in the
`create_product_and_versions_for_courseware_pages` hook, which runs after a course or
program page is published. When this hook is triggered, the call to
`page.specific_class.get_edit_handler()` will raise an `AttributeError`, causing the
page publishing process to fail. While tests exist for this functionality, they may not
be running or may be passing for other reasons, masking this critical runtime error.

"user-util==2.0.0",
"uwsgi==2.0.31",
"wagtail==5.2.8",
"wagtail==6.3.8",
"wagtail-metadata==5.0.0",
"xmltodict>=1.0.0,<2",
"zeep==4.3.2",
Expand Down
34 changes: 23 additions & 11 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading