Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: return 200 on embargo failure to prevent downstream error (#3993)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopappas authored Jun 23, 2023
1 parent 0730221 commit a4298d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ def test_embargo_failure(self, mock_embargo_check):
'user_ip_address': self.ip_address, 'username': self.user.username
})

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.status_code, status.HTTP_200_OK)
expected_data = {'error': 'User blocked by embargo check', 'error_code': 'embargo_failed'}
self.assertCountEqual(json.loads(response.content.decode('utf-8')), expected_data)
2 changes: 1 addition & 1 deletion ecommerce/bff/subscriptions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def post(self, request, *args, **kwargs):
)
return Response({'error': 'User blocked by embargo check',
'error_code': 'embargo_failed'},
status=status.HTTP_400_BAD_REQUEST)
status=status.HTTP_200_OK)

for product in available_products:
mode = self._mode_for_product(product)
Expand Down

0 comments on commit a4298d2

Please sign in to comment.