mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-05-30 11:13:13 +03:00
Fix for DjangoObjectPermissionsFilter with Guardian < 1.3
This commit is contained in:
parent
152035aee7
commit
59be95a0c0
|
@ -191,4 +191,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