mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-22 22:05:50 +00:00
Fix ability to pass a class object in subpage_types / parent_page_types
This commit is contained in:
parent
b4097dce1d
commit
fa558b149d
2 changed files with 3 additions and 3 deletions
|
|
@ -404,7 +404,7 @@ class BusinessSubIndex(Page):
|
|||
class BusinessChild(Page):
|
||||
""" Can only be placed under Business indexes, no children allowed """
|
||||
subpage_types = []
|
||||
parent_page_types = ['tests.BusinessIndex', 'tests.BusinessSubIndex']
|
||||
parent_page_types = ['tests.BusinessIndex', BusinessSubIndex]
|
||||
|
||||
|
||||
class SearchTest(models.Model, index.Indexed):
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ def resolve_model_string(model_string, default_app=None):
|
|||
raise LookupError("Can not resolve {0!r} into a model".format(model_string), model_string)
|
||||
return model
|
||||
|
||||
elif model_string is not None and issubclass(model_string, Model):
|
||||
return model
|
||||
elif isinstance(model_string, type) and issubclass(model_string, Model):
|
||||
return model_string
|
||||
|
||||
else:
|
||||
raise LookupError("Can not resolve {0!r} into a model".format(model_string), model_string)
|
||||
|
|
|
|||
Loading…
Reference in a new issue