Skip to content

Commit

Permalink
Merge branch 'master' of github.com:openedx/license-manager into ENT-…
Browse files Browse the repository at this point in the history
…9206/modify-license-mgr-bulk-revoke-behaviour
  • Loading branch information
hamzawaleed01 committed Sep 10, 2024
2 parents d249767 + 4cb33cc commit 394b7a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Adding new check for github-actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
14 changes: 7 additions & 7 deletions license_manager/apps/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,14 +1324,14 @@ def bulk_revoke(self, request, subscription_uuid=None):
Response Body:
{
"revocation_results": [
"successful_revocations": [
{
"license_uuid": "string",
"original_status": "string",
"user_email": "string"
}
],
"error_messages": [
"unsuccessful_revocations": [
{
"error": "string",
"error_response_status": "integer",
Expand Down Expand Up @@ -1365,7 +1365,7 @@ def bulk_revoke(self, request, subscription_uuid=None):
subscription_uuid,
)
return Response({
'error_messages': [
'unsuccessful_revocations': [
{'error': error_message}
]
},
Expand All @@ -1380,7 +1380,7 @@ def bulk_revoke(self, request, subscription_uuid=None):
if len(user_emails) > subscription_plan.num_revocations_remaining:
error_message = 'Plan does not have enough revocations remaining.'
return Response({
'error_messages': [
'unsuccessful_revocations': [
{'error': error_message}
]
}, status=status.HTTP_400_BAD_REQUEST)
Expand Down Expand Up @@ -1410,7 +1410,7 @@ def bulk_revoke(self, request, subscription_uuid=None):
# Case 1: if all revocations failed; return only the error messages list
if error_response_status and not revocation_results:
return Response({
'error_messages': error_messages
'unsuccessful_revocations': error_messages
},
status=error_response_status
)
Expand All @@ -1426,8 +1426,8 @@ def bulk_revoke(self, request, subscription_uuid=None):
'user_email': str(user_email)
})
results = {
'revocation_results': revocation_succeeded,
'error_messages': error_messages
'successful_revocations': revocation_succeeded,
'unsuccessful_revocations': error_messages
}
if not error_messages:
return Response(data=results, status=status.HTTP_200_OK)
Expand Down

0 comments on commit 394b7a0

Please sign in to comment.