summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikela Clemmons <glassresistor@gmail.com>2014-08-22 19:45:50 (GMT)
committerMikela Clemmons <glassresistor@gmail.com>2014-08-22 19:45:50 (GMT)
commit3b7ebe9f00b85486be5da9d9e10fcf46fd1e705b (patch)
tree367e6034e591300c65b68f59ec7e221b64916752
parent6b5bc0d3ad706d2aaa47fa476f38406cddd01236 (diff)
downloaddjango-oauth2-provider-3b7ebe9f00b85486be5da9d9e10fcf46fd1e705b.zip
django-oauth2-provider-3b7ebe9f00b85486be5da9d9e10fcf46fd1e705b.tar.gz
django-oauth2-provider-3b7ebe9f00b85486be5da9d9e10fcf46fd1e705b.tar.bz2
added httprequest fixes
-rw-r--r--provider/views.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/provider/views.py b/provider/views.py
index dd1200d..bb3a922 100644
--- a/provider/views.py
+++ b/provider/views.py
@@ -292,14 +292,13 @@ class Redirect(OAuthView, Mixin):
an error.
"""
- def error_response(self, error, mimetype='application/json', status=400,
+ def error_response(self, error, mimetype='deprecated', 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), mimetype=mimetype,
- status=status, **kwargs)
+ return HttpResponse(json.dumps(error), status=status, **kwargs)
def get(self, request):
data = self.get_data(request)
@@ -457,14 +456,13 @@ class AccessToken(OAuthView, Mixin):
"""
raise NotImplementedError
- def error_response(self, error, mimetype='application/json', status=400,
+ def error_response(self, error, mimetype='deprecated', 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), mimetype=mimetype,
- status=status, **kwargs)
+ return HttpResponse(json.dumps(error), status=status, **kwargs)
def access_token_response(self, access_token):
"""
@@ -487,9 +485,7 @@ class AccessToken(OAuthView, Mixin):
except ObjectDoesNotExist:
pass
- return HttpResponse(
- json.dumps(response_data), mimetype='application/json'
- )
+ return HttpResponse(json.dumps(response_data))
def authorization_code(self, request, data, client):
"""