diff --git a/rest_framework/permissions.py b/rest_framework/permissions.py index 484630ae7..01b74e877 100644 --- a/rest_framework/permissions.py +++ b/rest_framework/permissions.py @@ -123,7 +123,7 @@ 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.' + 'Return of {}.get_queryset() was None'.format(view.__class__.__name__) ) else: queryset = getattr(view, 'queryset', None)