Skip to content

Commit

Permalink
Merge branch 'master' into repo-tools/upgrade-python-requirements-19e…
Browse files Browse the repository at this point in the history
…8dfd
  • Loading branch information
macdiesel authored Jul 30, 2024
2 parents 2a7bf0e + cbd70cd commit 577b1dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions license_manager/apps/api/v1/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3172,7 +3172,8 @@ def test_bulk_revoke_license_not_found(self, mock_revoke_license):
assert response.status_code == status.HTTP_404_NOT_FOUND
expected_error_msg = (
"No license for email [email protected] exists in plan "
"{} with a status in ['activated', 'assigned']".format(self.subscription_plan.uuid)
"{} with a status in ['activated', 'assigned']. user_email: [email protected]".format(
self.subscription_plan.uuid)
)
self.assertEqual(expected_error_msg, response.json())
mock_revoke_license.assert_called_once_with(alice_license)
Expand Down Expand Up @@ -3203,7 +3204,7 @@ def test_bulk_revoke_license_revocation_error(self, mock_revoke_license):
assert response.status_code == status.HTTP_400_BAD_REQUEST
expected_error_msg = "Action: license revocation failed for license: {} because: {}".format(
alice_license.uuid,
'floor is lava',
'floor is lava. user_email: [email protected]',
)
self.assertEqual(expected_error_msg, response.json())
mock_revoke_license.assert_called_once_with(alice_license)
Expand Down
3 changes: 2 additions & 1 deletion license_manager/apps/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,8 +1358,9 @@ def bulk_revoke(self, request, subscription_uuid=None):
revocation_result = self._revoke_by_email_and_plan(user_email, subscription_plan)
revocation_results.append(revocation_result)
except (LicenseNotFoundError, LicenseRevocationError) as exc:
error_message = str(exc)
error_message = f'{str(exc)}. user_email: {user_email}'
error_response_status = utils.get_http_status_for_exception(exc)
logger.error(f'{error_message}, error_response_status:{error_response_status}')
break

if error_response_status:
Expand Down

0 comments on commit 577b1dd

Please sign in to comment.