8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-21 19:03:11 +00:00

Fix accessing view queryset property in api/permissions.py

Django would raise a RuntimeError indicating not to evaluate the .queryset attribute directly
This commit is contained in:
Jean-Romain Garnier 2021-01-05 21:09:45 +01:00
parent be8e6925af
commit 39b6e8507e

View file

@ -241,7 +241,7 @@ class AutodetectACLPermission(permissions.BasePermission):
# Bypass permission verifications if it is a functional view # Bypass permission verifications if it is a functional view
# (permissions are handled by ACL) # (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 return True
if not request.user or not request.user.is_authenticated: if not request.user or not request.user.is_authenticated: