浏览代码

Add ID for "non-existent field" system check

Partially addresses #8762.
Matt Westcott 2 年之前
父节点
当前提交
960dba276e
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      wagtail/search/index.py
  2. 1 0
      wagtail/search/tests/test_indexed_class.py

+ 1 - 0
wagtail/search/index.py

@@ -116,6 +116,7 @@ class Indexed:
                     checks.Warning(
                         message.format(model=cls.__name__, name=field.field_name),
                         obj=cls,
+                        id="wagtailsearch.W004",
                     )
                 )
         return errors

+ 1 - 0
wagtail/search/tests/test_indexed_class.py

@@ -107,6 +107,7 @@ class TestSearchFields(TestCase):
                 checks.Warning(
                     "Book.search_fields contains non-existent field 'foo'",
                     obj=models.Book,
+                    id="wagtailsearch.W004",
                 )
             ]
             errors = models.Book.check()