Hardcode the module path wagtail.wagtailcore.models.PageManager in system check message

The use of Manager.from_queryset means that __module__ / __name__ don't work reliably,
resulting in a misleading message - see https://groups.google.com/d/msg/wagtail/6vZExngYVu4/vQBecOckAwAJ
This commit is contained in:
Matt Westcott 2016-11-11 12:07:16 +00:00
parent 4b3ae1cbbf
commit c41af1fd8c

View file

@ -566,8 +566,7 @@ class Page(six.with_metaclass(PageBase, AbstractPage, index.Indexed, Clusterable
errors.append(
checks.Error(
"Manager does not inherit from PageManager",
hint="Ensure that custom Page managers inherit from {}.{}".format(
PageManager.__module__, PageManager.__name__),
hint="Ensure that custom Page managers inherit from wagtail.wagtailcore.models.PageManager",
obj=cls,
id='wagtailcore.E002',
)