Commit 39ec564a by Tom Christie

Do not access settings on compat import

parent 7905e9f9
...@@ -94,12 +94,11 @@ else: ...@@ -94,12 +94,11 @@ else:
# Django-guardian is optional. Import only if guardian is in INSTALLED_APPS # Django-guardian is optional. Import only if guardian is in INSTALLED_APPS
# Fixes (#1712). We keep the try/except for the test suite. # Fixes (#1712). We keep the try/except for the test suite.
guardian = None guardian = None
if 'guardian' in settings.INSTALLED_APPS: try:
try: import guardian
import guardian import guardian.shortcuts # Fixes #1624
import guardian.shortcuts # Fixes #1624 except ImportError:
except ImportError: pass
pass
def get_model_name(model_cls): def get_model_name(model_cls):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment