Browse Source

Fix accessing view queryset property in api/permissions.py

Django would raise a RuntimeError indicating not to evaluate the .queryset attribute directly
release-2.9
Jean-Romain Garnier 3 years ago
committed by Gabriel Detraz
parent
commit
c3a7e05496
  1. 2
      api/permissions.py

2
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:

Loading…
Cancel
Save