Skip to content

Commit c4e765e

Browse files
authored
Ignoring requests containing list instead of dict
If a request's body is a json list instead of a json object django-oauth-toolkit raises and exception. It breaks bulk requests for drf for example. This commit fixes it.
1 parent 86e8f9b commit c4e765e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

oauth2_provider/oauth2_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def extract_body(self, request):
180180
"""
181181
try:
182182
body = json.loads(request.body.decode("utf-8")).items()
183-
except ValueError:
183+
except AttributeError, ValueError:
184184
body = ""
185185

186186
return body

0 commit comments

Comments
 (0)