mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-05 05:54:44 +00:00
Catch LookupError when finding target model in PageChooserPanel
This commit is contained in:
parent
d817396e2b
commit
a7afdd52aa
1 changed files with 5 additions and 1 deletions
|
|
@ -491,7 +491,11 @@ class BasePageChooserPanel(BaseChooserPanel):
|
|||
except ValueError:
|
||||
raise ImproperlyConfigured("The page_type passed to PageChooserPanel must be of the form 'app_label.model_name'")
|
||||
|
||||
page_type = get_model(app_label, model_name)
|
||||
try:
|
||||
page_type = get_model(app_label, model_name)
|
||||
except LookupError:
|
||||
page_type = None
|
||||
|
||||
if page_type is None:
|
||||
raise ImproperlyConfigured("PageChooserPanel refers to model '%s' that has not been installed" % cls.page_type)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue