Skip to content

Commit 71d64a1

Browse files
committed
fix: allow integer sentinel in set_page_position URL for Wagtail probe
Wagtail calls reverse("wagtailadmin_pages:set_page_position", args=[999999]) to test URL existence before rendering the reorder button. The <object_id:> converter regex requires 24 hex chars, so 999999 fails. Switch to re_path accepting both formats; the view's ORM coerces the string to ObjectId.
1 parent 296e41b commit 71d64a1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • src/dbx_python_cli/templates/project_template/project_name/wagtail_urls/admin

src/dbx_python_cli/templates/project_template/project_name/wagtail_urls/admin/pages.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@
8585
move.move_confirm,
8686
name="move_confirm",
8787
),
88-
path(
89-
"<object_id:page_to_move_id>/set_position/",
88+
# re_path instead of <object_id:> so that Wagtail's reverse("...set_page_position",
89+
# args=[999999]) sentinel probe succeeds — the view's ORM query coerces the string to ObjectId.
90+
re_path(
91+
r"^(?P<page_to_move_id>[0-9a-fA-F]{24}|\d+)/set_position/$",
9092
ordering.set_page_position,
9193
name="set_page_position",
9294
),

0 commit comments

Comments
 (0)