Last active
August 29, 2015 14:18
-
-
Save Kniyl/8b7822cfa25eb20458cf to your computer and use it in GitHub Desktop.
Version checker for django 1.8 / modeltranslation 0.8.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mezzanine/utils/conf.py b/mezzanine/utils/conf.py | |
index 1f9c321..5d8bef2 100644 | |
--- a/mezzanine/utils/conf.py | |
+++ b/mezzanine/utils/conf.py | |
@@ -110,9 +110,15 @@ def set_dynamic_settings(s): | |
warn("USE_MODETRANSLATION setting is set to True but django-" | |
"modeltranslation is not installed. Disabling it.") | |
else: | |
- # Force i18n so we are assured that modeltranslation is active | |
- s["USE_I18N"] = True | |
- append("INSTALLED_APPS", "modeltranslation") | |
+ import django.VERSION as dVERSION | |
+ import modeltranslation.VERSION as mVERSION | |
+ if dVERSION > (1,8) and mVERSION < (0,8,2): | |
+ # Modeltranslation 0.8.1 is not compatible with django 1.8 | |
+ remove("INSTALLED_APPS", "modeltranslation") | |
+ else: | |
+ # Force i18n so we are assured that modeltranslation is active | |
+ s["USE_I18N"] = True | |
+ append("INSTALLED_APPS", "modeltranslation") | |
# Setup for optional apps. | |
optional = list(s.get("OPTIONAL_APPS", [])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment