mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 16:24:18 +03:00
Update compat.py
try to import guardian if it's in INSTALLED_APPS
This commit is contained in:
parent
85cd717ec0
commit
431ac45168
|
@ -81,8 +81,9 @@ except ImportError:
|
||||||
# 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
|
||||||
try:
|
try:
|
||||||
import guardian
|
if 'guardian' in settings.INSTALLED_APPS:
|
||||||
import guardian.shortcuts # Fixes #1624
|
import guardian
|
||||||
|
import guardian.shortcuts # Fixes #1624
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user