mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-01 07:26:34 +02:00
handling of failed email sends to domain managers
This commit is contained in:
parent
bc7bc4d6e1
commit
6634e9bad8
5 changed files with 36 additions and 22 deletions
|
@ -1410,7 +1410,7 @@ class BaseInvitationAdmin(ListHeaderAdmin):
|
|||
# store current messages from request so that they are preserved throughout the method
|
||||
storage = get_messages(request)
|
||||
# Check if there are any error or warning messages in the `messages` framework
|
||||
has_errors = any(message.level_tag in ["error", "warning"] for message in storage)
|
||||
has_errors = any(message.level_tag in ["error"] for message in storage)
|
||||
|
||||
if has_errors:
|
||||
# Re-render the change form if there are errors or warnings
|
||||
|
@ -1552,13 +1552,14 @@ class DomainInvitationAdmin(BaseInvitationAdmin):
|
|||
portfolio_invitation.save()
|
||||
messages.success(request, f"{requested_email} has been invited to the organization: {domain_org}")
|
||||
|
||||
send_domain_invitation_email(
|
||||
if not send_domain_invitation_email(
|
||||
email=requested_email,
|
||||
requestor=requestor,
|
||||
domains=domain,
|
||||
is_member_of_different_org=member_of_a_different_org,
|
||||
requested_user=requested_user,
|
||||
)
|
||||
):
|
||||
messages.warning(request, "Could not send email confirmation to existing domain managers.")
|
||||
if requested_user is not None:
|
||||
# Domain Invitation creation for an existing User
|
||||
obj.retrieve()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue