浏览代码

Show wagtail form submission in addition to CoderedForms (#606)

I had a legacy form page which inherits from Wagtail's own `FormMixin`,
rather than via CodeRed's models. This change simply includes those
pages in the admin. My form submission results were inaccessible,
otherwise.
Jon Culver 1 年之前
父节点
当前提交
6448e04dff
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      coderedcms/wagtail_hooks.py

+ 2 - 1
coderedcms/wagtail_hooks.py

@@ -88,11 +88,12 @@ def crx_forms(user, editable_forms):
     and wagtail.contrib.forms.get_form_types()
     """
     from coderedcms.models import CoderedFormMixin
+    from wagtail.contrib.forms.models import FormMixin
 
     form_models = [
         model
         for model in get_page_models()
-        if issubclass(model, CoderedFormMixin)
+        if issubclass(model, (FormMixin, CoderedFormMixin))
     ]
     form_types = list(ContentType.objects.get_for_models(*form_models).values())
     editable_forms = UserPagePermissionsProxy(user).editable_pages()