Skip to content

Commit

Permalink
chore: When trimming email addresses ignore failures when removing an…
Browse files Browse the repository at this point in the history
… email address multiple times.
  • Loading branch information
macdiesel committed Nov 27, 2023
1 parent fccf0c3 commit 8581fdd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion license_manager/apps/api/v1/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from collections import OrderedDict
from contextlib import suppress
from uuid import uuid4

from celery import chain
Expand Down Expand Up @@ -654,7 +655,8 @@ def _trim_already_associated_emails(self, subscription_plan, user_emails):
already_associated_licenses.values_list('user_email', flat=True)
)
for email in already_associated_emails:
trimmed_emails.remove(email.lower())
with suppress(ValueError):
trimmed_emails.remove(email.lower())

return trimmed_emails, already_associated_emails

Expand Down

0 comments on commit 8581fdd

Please sign in to comment.