Commit fe048dc4 by Xavier Ordoquy

Fix #1712 (issue when django-guardian is installed but not configured/used)

parent 299a8347
......@@ -48,12 +48,15 @@ try:
except ImportError:
django_filters = None
# guardian is optional
try:
import guardian
import guardian.shortcuts # Fixes #1624
except ImportError:
guardian = None
# Django-guardian is optional. Import only if guardian is in INSTALLED_APPS
# Fixes (#1712). We keep the try/except for the test suite.
guardian = None
if 'guardian' in settings.INSTALLED_APPS:
try:
import guardian
import guardian.shortcuts # Fixes #1624
except ImportError:
pass
# cStringIO only if it's available, otherwise StringIO
......
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