mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Adjust django-guardian check for PY2 compatible version. (#6613)
This commit is contained in:
parent
59a5a5a868
commit
bf9859de51
|
@ -168,7 +168,12 @@ def is_guardian_installed():
|
||||||
"""
|
"""
|
||||||
django-guardian is optional and only imported if in INSTALLED_APPS.
|
django-guardian is optional and only imported if in INSTALLED_APPS.
|
||||||
"""
|
"""
|
||||||
if six.PY2:
|
try:
|
||||||
|
import guardian
|
||||||
|
except ImportError:
|
||||||
|
guardian = None
|
||||||
|
|
||||||
|
if six.PY2 and (not guardian or guardian.VERSION >= (1, 5)):
|
||||||
# Guardian 1.5.0, for Django 2.2 is NOT compatible with Python 2.7.
|
# Guardian 1.5.0, for Django 2.2 is NOT compatible with Python 2.7.
|
||||||
# Remove when dropping PY2.
|
# Remove when dropping PY2.
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user