Fix ability to pass a class object in subpage_types / parent_page_types

This commit is contained in:
Matt Westcott 2014-09-16 15:44:42 +01:00
parent b4097dce1d
commit fa558b149d
2 changed files with 3 additions and 3 deletions

View file

@ -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):

View file

@ -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)