mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-06 09:45:23 +02:00
Re-revert email_success check
This commit is contained in:
parent
aec1a4f0d4
commit
76fc71382d
1 changed files with 3 additions and 2 deletions
|
@ -881,12 +881,13 @@ class DomainAddUserView(DomainFormBaseView):
|
|||
Throws EmailSendingError."""
|
||||
requested_email = form.cleaned_data["email"]
|
||||
requestor = self.request.user
|
||||
email_success = True
|
||||
email_success = False
|
||||
# look up a user with that email
|
||||
try:
|
||||
requested_user = User.objects.get(email=requested_email)
|
||||
except User.DoesNotExist:
|
||||
# no matching user, go make an invitation
|
||||
email_success = True
|
||||
return self._make_invitation(requested_email, requestor)
|
||||
else:
|
||||
# if user already exists then just send an email
|
||||
|
@ -894,6 +895,7 @@ class DomainAddUserView(DomainFormBaseView):
|
|||
self._send_domain_invitation_email(
|
||||
requested_email, requestor, requested_user=requested_user, add_success=False
|
||||
)
|
||||
email_success = True
|
||||
except EmailSendingError:
|
||||
logger.warn(
|
||||
"Could not send email invitation (EmailSendingError)",
|
||||
|
@ -902,7 +904,6 @@ class DomainAddUserView(DomainFormBaseView):
|
|||
)
|
||||
messages.warning(self.request, "Could not send email invitation.")
|
||||
except OutsideOrgMemberError:
|
||||
email_send = False
|
||||
logger.warn(
|
||||
"Could not send email. Can not invite member of a .gov organization to a different organization.",
|
||||
self.object,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue