mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-29 21:14:01 +03:00
Fix for DjangoObjectPermissionsFilter with Guardian < 1.3
This commit is contained in:
parent
99d9afc9d0
commit
798cd1a637
|
@ -201,4 +201,6 @@ class DjangoObjectPermissionsFilter(BaseFilterBackend):
|
||||||
if guardian.VERSION >= (1, 3):
|
if guardian.VERSION >= (1, 3):
|
||||||
# Maintain behavior compatibility with versions prior to 1.3
|
# Maintain behavior compatibility with versions prior to 1.3
|
||||||
extra = {'accept_global_perms': False}
|
extra = {'accept_global_perms': False}
|
||||||
|
else:
|
||||||
|
extra = {}
|
||||||
return guardian.shortcuts.get_objects_for_user(user, permission, queryset, **extra)
|
return guardian.shortcuts.get_objects_for_user(user, permission, queryset, **extra)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user