summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikela Clemmons <glassresistor@gmail.com>2014-08-25 19:16:12 (GMT)
committerMikela Clemmons <glassresistor@gmail.com>2014-08-25 19:16:12 (GMT)
commit31cb8bcdccd6d6338a6727eb618a642f5bf2c508 (patch)
treeab52e32cb5963eeac9e28819b9fa0937d4c2bef8
parent4a5ba08082a2a631f0d53fc59fd89dcb15b7b7c6 (diff)
downloaddjango-oauth2-provider-31cb8bcdccd6d6338a6727eb618a642f5bf2c508.zip
django-oauth2-provider-31cb8bcdccd6d6338a6727eb618a642f5bf2c508.tar.gz
django-oauth2-provider-31cb8bcdccd6d6338a6727eb618a642f5bf2c508.tar.bz2
Revert "added httprequest fixes"
This reverts commit 3b7ebe9f00b85486be5da9d9e10fcf46fd1e705b.
-rw-r--r--provider/views.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/provider/views.py b/provider/views.py
index bb3a922..dd1200d 100644
--- a/provider/views.py
+++ b/provider/views.py
@@ -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):
"""