more updates and fixes to invitation logging and exception handling

This commit is contained in:
David Kennedy 2025-01-29 16:00:02 -05:00
parent 6634e9bad8
commit dfb7c6d875
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
3 changed files with 3 additions and 4 deletions

View file

@ -85,7 +85,7 @@ def send_emails_to_domain_managers(email: str, requestor_email, domain: Domain,
},
)
except EmailSendingError as err:
logger.warning(f"Could not send email manager notification to {user.email} for domain: {domain.name}")
logger.warning(f"Could not send email manager notification to {user.email} for domain: {domain.name}", exc_info=True)
all_emails_sent = False
return all_emails_sent

View file

@ -801,7 +801,7 @@ class PortfolioAddMemberView(PortfolioMembersPermissionView, FormMixin):
portfolio,
exc_info=True,
)
messages.warning(self.request, "Could not send email invitation.")
messages.warning(self.request, "Could not send portfolio email invitation.")
elif isinstance(exception, MissingEmailError):
messages.error(self.request, str(exception))
logger.error(
@ -810,4 +810,4 @@ class PortfolioAddMemberView(PortfolioMembersPermissionView, FormMixin):
)
else:
logger.warning("Could not send email invitation (Other Exception)", exc_info=True)
messages.warning(self.request, "Could not send email invitation.")
messages.warning(self.request, "Could not send portfolio email invitation.")

View file

@ -68,7 +68,6 @@ def handle_invitation_exceptions(request, exception, email):
logger.error(str(exception), exc_info=True)
elif isinstance(exception, OutsideOrgMemberError):
messages.error(request, str(exception))
logger.warning(str(exception), exc_info=True)
elif isinstance(exception, AlreadyDomainManagerError):
messages.error(request, str(exception))
elif isinstance(exception, AlreadyDomainInvitedError):