Browse Source

Add ID for "non-existent field" system check

Partially addresses #8762.
Matt Westcott 2 years ago
parent
commit
960dba276e
2 changed files with 2 additions and 0 deletions
  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()