Skip to content

Commit

Permalink
fix: Fix django version detect during install
Browse files Browse the repository at this point in the history
  • Loading branch information
last-partizan committed May 14, 2022
1 parent 79d2e08 commit 876f2e7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modeltranslation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from pathlib import Path
from django import VERSION as _django_version

__version__ = (Path(__file__).parent / "VERSION").open().read().strip()
try:
from django import VERSION as _django_version

if _django_version < (3, 2):
default_app_config = 'modeltranslation.apps.ModeltranslationConfig'
except ImportError:
pass

if _django_version < (3, 2):
default_app_config = 'modeltranslation.apps.ModeltranslationConfig'
__version__ = (Path(__file__).parent / "VERSION").open().read().strip()

0 comments on commit 876f2e7

Please sign in to comment.