Commit 5fd01d06 by Felipe Bidu

Adding a more explicit error message when a view does have a get_queryset method…

Adding a more explicit error message when a view does have a get_queryset method but it returned nothing
parent fed85bc2
......@@ -122,6 +122,9 @@ class DjangoModelPermissions(BasePermission):
if hasattr(view, 'get_queryset'):
queryset = view.get_queryset()
assert queryset is not None, (
'The `.get_queryset()` method from the view did not return anything.'
)
else:
queryset = getattr(view, 'queryset', None)
......
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