mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-04-30 14:03:44 +03:00
Do not access settings on compat import
This commit is contained in:
parent
7905e9f9f4
commit
39ec564ae9
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user