parent
4a5ba08082
commit
31cb8bcdcc
|
@ -292,13 +292,14 @@ class Redirect(OAuthView, Mixin):
|
|||
an error.
|
||||
"""
|
||||
|
||||
def error_response(self, error, mimetype='deprecated', status=400,
|
||||
def error_response(self, error, mimetype='application/json', status=400,
|
||||
**kwargs):
|
||||
"""
|
||||
Return an error response to the client with default status code of
|
||||
*400* stating the error as outlined in :rfc:`5.2`.
|
||||
"""
|
||||
return HttpResponse(json.dumps(error), status=status, **kwargs)
|
||||
return HttpResponse(json.dumps(error), mimetype=mimetype,
|
||||
status=status, **kwargs)
|
||||
|
||||
def get(self, request):
|
||||
data = self.get_data(request)
|
||||
|
@ -456,13 +457,14 @@ class AccessToken(OAuthView, Mixin):
|
|||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def error_response(self, error, mimetype='deprecated', status=400,
|
||||
def error_response(self, error, mimetype='application/json', status=400,
|
||||
**kwargs):
|
||||
"""
|
||||
Return an error response to the client with default status code of
|
||||
*400* stating the error as outlined in :rfc:`5.2`.
|
||||
"""
|
||||
return HttpResponse(json.dumps(error), status=status, **kwargs)
|
||||
return HttpResponse(json.dumps(error), mimetype=mimetype,
|
||||
status=status, **kwargs)
|
||||
|
||||
def access_token_response(self, access_token):
|
||||
"""
|
||||
|
@ -485,7 +487,9 @@ class AccessToken(OAuthView, Mixin):
|
|||
except ObjectDoesNotExist:
|
||||
pass
|
||||
|
||||
return HttpResponse(json.dumps(response_data))
|
||||
return HttpResponse(
|
||||
json.dumps(response_data), mimetype='application/json'
|
||||
)
|
||||
|
||||
def authorization_code(self, request, data, client):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue