From 65be82e8fdc7ab65f7b04c36e0644c81695c14f5 Mon Sep 17 00:00:00 2001 From: "b.khasanov" Date: Thu, 26 May 2016 19:02:36 +0300 Subject: [PATCH] Wrap guardian.VERSION in tuple, in django-guardian 1.4.2 version has list type and comparison fails. --- rest_framework/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/filters.py b/rest_framework/filters.py index a510d3bf6..532cb053a 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -308,7 +308,7 @@ class DjangoObjectPermissionsFilter(BaseFilterBackend): 'model_name': model_cls._meta.model_name } permission = self.perm_format % kwargs - if guardian.VERSION >= (1, 3): + if tuple(guardian.VERSION) >= (1, 3): # Maintain behavior compatibility with versions prior to 1.3 extra = {'accept_global_perms': False} else: