Skip to content

Commit 190f620

Browse files
Update Django Guardian dependency. (#6430)
* Update Django Guardian dependency. * Skip testing Guardian on PY2. See django-guardian/django-guardian#602
1 parent bd9a799 commit 190f620

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

requirements/requirements-optionals.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Optional packages which may be used with REST framework.
22
psycopg2-binary==2.7.5
33
markdown==2.6.11
4-
django-guardian==1.4.9
4+
django-guardian==1.5.0
55
django-filter==1.1.0
66
coreapi==2.3.1
77
coreschema==0.0.4

rest_framework/compat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ def is_guardian_installed():
161161
"""
162162
django-guardian is optional and only imported if in INSTALLED_APPS.
163163
"""
164+
if six.PY2:
165+
# Guardian 1.5.0, for Django 2.2 is NOT compatible with Python 2.7.
166+
# Remove when dropping PY2.
167+
return False
164168
return 'guardian' in settings.INSTALLED_APPS
165169

166170

0 commit comments

Comments
 (0)