Skip to content

Commit

Permalink
Merge pull request #687 from openedx/pwnage101/no-pending-licenses-do…
Browse files Browse the repository at this point in the history
…esnt-throw

fix: Don't throw an exception if no pending licenses were found
  • Loading branch information
pwnage101 committed Jul 30, 2024
2 parents 30574c3 + 4693622 commit 6fffc31
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions license_manager/apps/api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ def _batch_notify_or_remind_assigned_emails(
if len(pending_licenses) > allowed_batch_size:
raise Exception(f'Found more than {allowed_batch_size} licenses, no email sent to {action_type}')

if len(pending_licenses) == 0:
logger.warning(
f'{LICENSE_DEBUG_PREFIX} No pending licenses found for given emails, no email sent to {action_type}.'
)
return pending_licenses

enterprise_api_client = EnterpriseApiClient()
enterprise_customer = enterprise_api_client.get_enterprise_customer_data(
subscription_plan.enterprise_customer_uuid,
Expand Down

0 comments on commit 6fffc31

Please sign in to comment.