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

fix: return 200 on embargo failure to prevent downstream error #3993

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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