mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-13 04:59:59 +02:00
Revert to try else catch
This commit is contained in:
parent
3d1781c4f6
commit
117900cfb9
1 changed files with 3 additions and 2 deletions
|
@ -857,8 +857,6 @@ class DomainAddUserView(DomainFormBaseView):
|
||||||
"requestor_email": requestor_email,
|
"requestor_email": requestor_email,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if add_success:
|
|
||||||
messages.success(self.request, f"{email} has been invited to this domain.")
|
|
||||||
except EmailSendingError as exc:
|
except EmailSendingError as exc:
|
||||||
logger.warn(
|
logger.warn(
|
||||||
"Could not sent email invitation to %s for domain %s",
|
"Could not sent email invitation to %s for domain %s",
|
||||||
|
@ -867,6 +865,9 @@ class DomainAddUserView(DomainFormBaseView):
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
raise EmailSendingError("Could not send email invitation.") from exc
|
raise EmailSendingError("Could not send email invitation.") from exc
|
||||||
|
else:
|
||||||
|
if add_success:
|
||||||
|
messages.success(self.request, f"{email} has been invited to this domain.")
|
||||||
|
|
||||||
def _make_invitation(self, email_address: str, requestor: User):
|
def _make_invitation(self, email_address: str, requestor: User):
|
||||||
"""Make a Domain invitation for this email and redirect with a message."""
|
"""Make a Domain invitation for this email and redirect with a message."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue