Merge pull request #3485 from dulmandakh/dulmandakh-guardian-check-installed-apps

Update compat.py
This commit is contained in:
Xavier Ordoquy 2015-10-09 08:13:42 +02:00
commit fa1cfae991

View File

@ -81,8 +81,9 @@ except ImportError:
# Fixes (#1712). We keep the try/except for the test suite.
guardian = None
try:
import guardian
import guardian.shortcuts # Fixes #1624
if 'guardian' in settings.INSTALLED_APPS:
import guardian
import guardian.shortcuts # Fixes #1624
except ImportError:
pass