mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
Update views.py
message field of Permission class is not going to be ignored when the user is not authenticated
This commit is contained in:
parent
81fa4b4f75
commit
51d5fde5c9
|
@ -173,7 +173,7 @@ class APIView(View):
|
||||||
If request is not permitted, determine what kind of exception to raise.
|
If request is not permitted, determine what kind of exception to raise.
|
||||||
"""
|
"""
|
||||||
if request.authenticators and not request.successful_authenticator:
|
if request.authenticators and not request.successful_authenticator:
|
||||||
raise exceptions.NotAuthenticated()
|
raise exceptions.NotAuthenticated(detail=message)
|
||||||
raise exceptions.PermissionDenied(detail=message)
|
raise exceptions.PermissionDenied(detail=message)
|
||||||
|
|
||||||
def throttled(self, request, wait):
|
def throttled(self, request, wait):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user