From c3a7e054969100ec4be4e839f2f924c3417dda22 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Tue, 5 Jan 2021 21:09:45 +0100 Subject: [PATCH] Fix accessing view queryset property in api/permissions.py Django would raise a RuntimeError indicating not to evaluate the .queryset attribute directly --- api/permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/permissions.py b/api/permissions.py index 646682c4..7ab96f1e 100644 --- a/api/permissions.py +++ b/api/permissions.py @@ -241,7 +241,7 @@ class AutodetectACLPermission(permissions.BasePermission): # Bypass permission verifications if it is a functional view # (permissions are handled by ACL) - if not getattr(view, "queryset", getattr(view, "get_queryset", None)): + if not hasattr(view, "queryset") and not hasattr(view, "get_queryset"): return True if not request.user or not request.user.is_authenticated: