Commits

Anonymous committed 12a68ff

Resolved a race condition between model import and translation registration in production by ensuring that models are registered for translation before TranslationAdmin runs. Resolves issue 19 (thanks to carl.j.meyer).

  • Participants
  • Parent commits d0538a2

Comments (0)

Files changed (1)

modeltranslation/admin.py

 
 from modeltranslation.translator import translator
 from modeltranslation.utils import get_translation_fields
+# Ensure that models are registered for translation before TranslationAdmin
+# runs. The import is supposed to resolve a race condition between model import
+# and translation registration in production (see issue 19).
+import modeltranslation.models
+
 
 class TranslationAdminBase(object):
     """