From 51d5fde5c98f2a53adf529093f103e0b1c5ff01b Mon Sep 17 00:00:00 2001 From: Yaser Amiri Date: Thu, 9 Aug 2018 12:17:43 +0430 Subject: [PATCH] Update views.py message field of Permission class is not going to be ignored when the user is not authenticated --- rest_framework/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/views.py b/rest_framework/views.py index 70af84816..c25b6c38c 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -173,7 +173,7 @@ class APIView(View): If request is not permitted, determine what kind of exception to raise. """ if request.authenticators and not request.successful_authenticator: - raise exceptions.NotAuthenticated() + raise exceptions.NotAuthenticated(detail=message) raise exceptions.PermissionDenied(detail=message) def throttled(self, request, wait):