Skip to content

Commit

Permalink
added request name to response
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-karpovich committed Jul 16, 2020
1 parent a1f9ec2 commit 33b2e20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drf_batch_requests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def post(self, request, *args, **kwargs):
continue

result = {
'name': current_request.name,
'code': response.status_code,
'headers': [
{'name': key, 'value': value}
Expand All @@ -91,5 +92,5 @@ def post(self, request, *args, **kwargs):
if is_completed:
break

ordered_responses = [responses.get(name, {'code': 418}) for name in ordered_names]
ordered_responses = [responses.get(name, {'name': name, 'code': 418}) for name in ordered_names]
return self.finalize_response(request, Response(ordered_responses))

0 comments on commit 33b2e20

Please sign in to comment.