Fix Comments admin 500 on snippet index #38
Reference in New Issue
Block a user
Delete Branch "fix/comments-admin-500-issue-37"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Columnforpending_in_articlepending_in_articleviewset method/short_description wiring/cms/snippets/comments/comment/loads for an admin userValidation
docker compose run --rm web pytest -q apps/comments/tests/test_admin.py --no-covdocker 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
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.
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.