mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-30 05:24:00 +03:00
Merge pull request #3485 from dulmandakh/dulmandakh-guardian-check-installed-apps
Update compat.py
This commit is contained in:
commit
fa1cfae991
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user