mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
fix APIView.permission_denied : NotAuthenticated exception can use user defined message
This commit is contained in:
parent
836e49b535
commit
ed63f6eee3
|
@ -167,7 +167,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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user