Skip to content

Commit eda18ca

Browse files
committed
Fix possible crash in validator when 'client' key is mentioned in request body
1 parent bd865d6 commit eda18ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

oauth2_provider/oauth2_validators.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ def _load_application(self, client_id, request):
193193
assert hasattr(request, "client"), '"request" instance has no "client" attribute'
194194

195195
try:
196-
request.client = request.client or Application.objects.get(client_id=client_id)
196+
if not isinstance(request.client, Application):
197+
request.client = Application.objects.get(client_id=client_id)
197198
# Check that the application can be used (defaults to always True)
198199
if not request.client.is_usable(request):
199200
log.debug("Failed body authentication: Application %r is disabled" % (client_id))

0 commit comments

Comments
 (0)