Form submissions return 404 with Wagtail 7.x due to FormMixin isinstance check

Aperta
#710 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
django, python
Ambito
backend

Direzione di ricerca

Inizia da coderedcms.models e ispeziona CoderedFormMixin insieme a wagtail/contrib/forms/views.py, in particolare get_submissions_list_view e il controllo FormMixin di Wagtail. Riconcilia i mixin senza interrompere il comportamento esistente dei form, quindi verifica che l'URL delle submission dell'amministrazione non restituisca più 404 per un form CodeRed su Wagtail 7.x.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

As @vsalvino and the team know, I am not a programmer and tend to find my way by trial and error (mostly error). So, like many people lately, I've been using Claude Code to assist with web development. The error description below was created by Claude in response to an error I am seeing. I apologize if it's inappropriate to post an issue generated by an LLM (it does look like a pretty good issue description, though...).

Description

Form submissions are inaccessible in the Wagtail admin (404 error) when using CodeRed CMS 6.0 with Wagtail 7.x. The Forms listing page shows forms correctly, but clicking to view submissions returns a 404.

Steps to Reproduce

  1. Install CodeRed CMS 6.0.0 with Wagtail 7.1.x
  2. Create a FormPage with some form fields
  3. Submit the form a few times to create submissions
  4. Go to Wagtail admin → Forms
  5. Click on the form page to view submissions
  6. Result: 404 error at /admin/forms/submissions/<page_id>/

Root Cause

In May 2025, Wagtail added an isinstance check in wagtail/contrib/forms/views.py (commit efd5d49):

def get_submissions_list_view(request, *args, **kwargs):
    page_id = kwargs.get("page_id")
    form_page = get_object_or_404(Page, id=page_id).specific
    if not isinstance(form_page, FormMixin):
        raise Http404  # <-- This causes the 404
    return form_page.serve_submissions_list_view(request, *args, **kwargs)

The problem is that CoderedFormMixin does not inherit from wagtail.contrib.forms.models.FormMixin:

>>> from wagtail.contrib.forms.models import FormMixin
>>> from coderedcms.models import CoderedFormPage, CoderedFormMixin
>>> issubclass(CoderedFormPage, FormMixin)
False
>>> issubclass(CoderedFormMixin, FormMixin)
False

Suggested Fix

CoderedFormMixin should inherit from wagtail.contrib.forms.models.FormMixin to pass the isinstance check. This may require reconciling any method/attribute conflicts between the two mixins.

Alternatively, CodeRed CMS could register its own URL route for form submissions that bypasses Wagtail's check.

Environment

  • CodeRed CMS: 6.0.0
  • Wagtail: 7.1.1
  • Python: 3.14
  • Django: 5.1.x

Related

This likely also affects wagtail-flexible-forms since StreamFormMixin similarly does not inherit from Wagtail's FormMixin.

Lingua principale
Python
Stelle
765
Fork
154
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coderedcorp/coderedcms

Tutte le issue di coderedcorp/coderedcms

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.