mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
removed else from message success
This commit is contained in:
parent
c043f44ef9
commit
8da02de034
1 changed files with 4 additions and 3 deletions
|
@ -839,6 +839,7 @@ class DomainAddUserView(DomainFormBaseView):
|
||||||
|
|
||||||
# Check to see if an invite has already been sent (NOTE: we do not want to create an invite just yet.)
|
# Check to see if an invite has already been sent (NOTE: we do not want to create an invite just yet.)
|
||||||
try:
|
try:
|
||||||
|
add_success=False
|
||||||
invite = DomainInvitation.objects.get(email=email, domain=self.object)
|
invite = DomainInvitation.objects.get(email=email, domain=self.object)
|
||||||
# that invitation already existed
|
# that invitation already existed
|
||||||
if invite.status == DomainInvitation.DomainInvitationStatus.RETRIEVED:
|
if invite.status == DomainInvitation.DomainInvitationStatus.RETRIEVED:
|
||||||
|
@ -880,7 +881,7 @@ class DomainAddUserView(DomainFormBaseView):
|
||||||
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."""
|
||||||
try:
|
try:
|
||||||
self._send_domain_invitation_email(email=email_address, requestor=requestor, add_success=False)
|
self._send_domain_invitation_email(email=email_address, requestor=requestor)
|
||||||
except EmailSendingError:
|
except EmailSendingError:
|
||||||
messages.warning(self.request, "Could not send email invitation.")
|
messages.warning(self.request, "Could not send email invitation.")
|
||||||
else:
|
else:
|
||||||
|
@ -927,8 +928,8 @@ class DomainAddUserView(DomainFormBaseView):
|
||||||
except IntegrityError:
|
except IntegrityError:
|
||||||
# User already has the desired role! Do nothing??
|
# User already has the desired role! Do nothing??
|
||||||
pass
|
pass
|
||||||
else:
|
|
||||||
messages.success(self.request, f"Added user {requested_email}.")
|
messages.success(self.request, f"Added user {requested_email}.")
|
||||||
|
|
||||||
return redirect(self.get_success_url())
|
return redirect(self.get_success_url())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue