Fix Comments admin 500 on snippet index #38

Merged
mark merged 1 commits from fix/comments-admin-500-issue-37 into main 2026-03-03 13:31:40 +00:00
Owner

Summary

  • fix Wagtail snippet list rendering for Comments by using an explicit Column for pending_in_article
  • remove the unused pending_in_article viewset method/short_description wiring
  • add regression test to assert /cms/snippets/comments/comment/ loads for an admin user

Validation

  • docker compose run --rm web pytest -q apps/comments/tests/test_admin.py --no-cov
  • docker compose run --rm -e ALLOWED_HOSTS='testserver,localhost,127.0.0.1,web' web python manage.py shell -c "from django.contrib.auth import get_user_model; from django.test import Client; U=get_user_model(); u, _ = U.objects.get_or_create(username='tmpadmin', defaults={'email':'tmpadmin@example.com','is_staff':True,'is_superuser':True}); u.is_staff=True; u.is_superuser=True; u.save(); c=Client(); c.force_login(u); r=c.get('/cms/snippets/comments/comment/'); print('status', r.status_code)"

Closes #37

## Summary - fix Wagtail snippet list rendering for Comments by using an explicit `Column` for `pending_in_article` - remove the unused `pending_in_article` viewset method/short_description wiring - add regression test to assert `/cms/snippets/comments/comment/` loads for an admin user ## Validation - `docker compose run --rm web pytest -q apps/comments/tests/test_admin.py --no-cov` - `docker compose run --rm -e ALLOWED_HOSTS='testserver,localhost,127.0.0.1,web' web python manage.py shell -c "from django.contrib.auth import get_user_model; from django.test import Client; U=get_user_model(); u, _ = U.objects.get_or_create(username='tmpadmin', defaults={'email':'tmpadmin@example.com','is_staff':True,'is_superuser':True}); u.is_staff=True; u.is_superuser=True; u.save(); c=Client(); c.force_login(u); r=c.get('/cms/snippets/comments/comment/'); print('status', r.status_code)"` Closes #37
mark added 1 commit 2026-03-03 13:21:17 +00:00
Fix comments snippet admin 500
All checks were successful
CI / nightly-e2e (pull_request) Has been skipped
CI / deploy (pull_request) Has been skipped
CI / ci (pull_request) Successful in 1m15s
CI / pr-e2e (pull_request) Successful in 1m36s
73b023dca2
Use an explicit Wagtail Column for pending_in_article in CommentViewSet list_display and add a regression test for /cms/snippets/comments/comment/.

Fixes #37

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
codex_a requested changes 2026-03-03 13:28:04 +00:00
Dismissed
codex_a left a comment
Owner

Requesting changes: this PR includes many unrelated files (blog/core/templates/workflow/config) beyond the Issue #37 comments-admin 500 fix, which makes scope/risk too high for safe review. Please rebase/cherry-pick only the comments fix and regression test into a clean branch targeting main. The comments-specific changes (Column for pending_in_article + admin index regression test) look directionally correct.

Requesting changes: this PR includes many unrelated files (blog/core/templates/workflow/config) beyond the Issue #37 comments-admin 500 fix, which makes scope/risk too high for safe review. Please rebase/cherry-pick only the comments fix and regression test into a clean branch targeting main. The comments-specific changes (Column for pending_in_article + admin index regression test) look directionally correct.
codex_a approved these changes 2026-03-03 13:30:54 +00:00
codex_a left a comment
Owner

Re-reviewed after updating local main to latest origin/main. Scope is now correctly limited to Issue #37 (apps/comments/wagtail_hooks.py + apps/comments/tests/test_admin.py). The fix is correct: list_display uses an explicit Column for pending_in_article and includes a regression test for /cms/snippets/comments/comment/ returning 200. Validation passed: docker compose run --rm web pytest -q apps/comments/tests/test_admin.py --no-cov.

Re-reviewed after updating local main to latest origin/main. Scope is now correctly limited to Issue #37 (apps/comments/wagtail_hooks.py + apps/comments/tests/test_admin.py). The fix is correct: list_display uses an explicit Column for pending_in_article and includes a regression test for /cms/snippets/comments/comment/ returning 200. Validation passed: docker compose run --rm web pytest -q apps/comments/tests/test_admin.py --no-cov.
mark merged commit 2d93555c60 into main 2026-03-03 13:31:40 +00:00
mark deleted branch fix/comments-admin-500-issue-37 2026-03-03 13:31:40 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nohype/main-site#38