mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-05-19 12:41:14 +00:00
Added panel patching for settings subclasses.
This commit is contained in:
parent
63bda25e11
commit
fa3fa07922
1 changed files with 3 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ import logging
|
|||
import django
|
||||
import warnings
|
||||
from patch_wagtailadmin import WagtailTranslator
|
||||
from wagtail.contrib.settings.models import BaseSetting
|
||||
from wagtail.wagtailcore.models import Page
|
||||
from wagtail.wagtailsnippets.models import get_snippet_models
|
||||
|
||||
|
|
@ -58,9 +59,9 @@ def autodiscover():
|
|||
for module in TRANSLATION_FILES:
|
||||
import_module(module)
|
||||
|
||||
# After all models being registered the Page subclasses and snippets are patched
|
||||
# After all models being registered the Page or BaseSetting subclasses and snippets are patched
|
||||
for model in translator.get_registered_models():
|
||||
if issubclass(model, Page) or model in get_snippet_models():
|
||||
if issubclass(model, Page) or model in get_snippet_models() or issubclass(model, BaseSetting):
|
||||
WagtailTranslator(model)
|
||||
|
||||
# In debug mode, print a list of registered models and pid to stdout.
|
||||
|
|
|
|||
Loading…
Reference in a new issue