mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-05-13 01:33:17 +00:00
Changed validation on _new_route to check if the object is an instance of RoutablePageMixin
This commit is contained in:
parent
5361ae777f
commit
791a9c003a
1 changed files with 3 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ from modeltranslation.translator import translator, NotRegistered
|
|||
from modeltranslation.utils import build_localized_fieldname, get_language
|
||||
from wagtail.contrib.settings.models import BaseSetting
|
||||
from wagtail.contrib.settings.views import get_setting_edit_handler
|
||||
from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel, \
|
||||
MultiFieldPanel, FieldRowPanel, InlinePanel, StreamFieldPanel, RichTextFieldPanel
|
||||
from wagtail.wagtailcore.models import Page, Site
|
||||
|
|
@ -263,9 +264,9 @@ def _new_route(self, request, path_components):
|
|||
"""
|
||||
Rewrite route method in order to handle languages fallbacks
|
||||
"""
|
||||
## copied from wagtail/contrib/wagtailroutablepage/models.py mixin ##
|
||||
# copied from wagtail/contrib/wagtailroutablepage/models.py mixin ##
|
||||
# Override route when Page is also RoutablePage
|
||||
if hasattr(self, 'resolve_subpage'):
|
||||
if isinstance(self, RoutablePageMixin):
|
||||
if self.live:
|
||||
try:
|
||||
path = '/'
|
||||
|
|
|
|||
Loading…
Reference in a new issue