Update apps.py

This commit is contained in:
Pomax 2019-03-19 11:36:42 -07:00 committed by GitHub
parent 304554f405
commit 372a2f31df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,10 +21,10 @@ class ModeltranslationConfig(AppConfig):
# update both the standard settings and the modeltranslation settings,
# as we cannot guarantee the load order, and so django_modeltranslation
# may bootstrap itself either before, or after, our ready() gets called.
custom_fields = getattr(settings, 'MODELTRANSLATION_CUSTOM_FIELDS', ())
custom_fields = getattr(settings, 'MODELTRANSLATION_CUSTOM_FIELDS', list())
setattr(settings, 'MODELTRANSLATION_CUSTOM_FIELDS', list(set(custom_fields + wagtail_fields)))
mt_custom_fields = getattr(mt_settings, 'CUSTOM_FIELDS', ())
mt_custom_fields = getattr(mt_settings, 'CUSTOM_FIELDS', list())
setattr(mt_settings, 'CUSTOM_FIELDS', list(set(mt_custom_fields + wagtail_fields)))
from modeltranslation.models import handle_translation_registrations