Allow DjangoObjectPermissions to use views that define get_queryset by ticosax · Pull Request #2905 · encode/django-rest-framework (original) (raw)

Mainly for two reasons:
1 - To honour getattr(view, '_ignore_model_permissions', False) behaviour. Since some views without .queryset are tolerated.
2 - Because the absence of queryset is raised few lines below with an adhoc error message.

assert queryset is not None, ( 'Cannot apply DjangoModelPermissions on a view that ' )

I thought it would be nice to keep it that way, to be consistent with DjangoModelPermissions