From 798cd1a637dbcfb18cb8718e6891060112fd383c Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 27 Jul 2015 10:20:37 +0100 Subject: [PATCH] Fix for DjangoObjectPermissionsFilter with Guardian < 1.3 --- rest_framework/filters.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest_framework/filters.py b/rest_framework/filters.py index a5e06b574..8c45299e7 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -201,4 +201,6 @@ class DjangoObjectPermissionsFilter(BaseFilterBackend): if guardian.VERSION >= (1, 3): # Maintain behavior compatibility with versions prior to 1.3 extra = {'accept_global_perms': False} + else: + extra = {} return guardian.shortcuts.get_objects_for_user(user, permission, queryset, **extra)