Commit c3a7e054 authored by jr-garnier's avatar jr-garnier Committed by Gabriel Detraz
Browse files

Fix accessing view queryset property in api/

Django would raise a RuntimeError indicating not to evaluate the .queryset attribute directly
parent 9669ab68
......@@ -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:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment