Commit fe048dc4 by Xavier Ordoquy

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

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