Skip to content

Commit

Permalink
Cherry picks
Browse files Browse the repository at this point in the history
Upgrade guardian support to 1.3. encode#3165
  • Loading branch information
tomchristie authored and damycra committed Jul 23, 2015
1 parent 86f7967 commit 152035a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rest_framework/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,7 @@ def filter_queryset(self, request, queryset, view):
'model_name': get_model_name(model_cls)
}
permission = self.perm_format % kwargs
return guardian.shortcuts.get_objects_for_user(user, permission, queryset)
if guardian.VERSION >= (1, 3):
# Maintain behavior compatibility with versions prior to 1.3
extra = {'accept_global_perms': False}
return guardian.shortcuts.get_objects_for_user(user, permission, queryset, **extra)

0 comments on commit 152035a

Please sign in to comment.