mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 12:08:40 +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.)
|
||||
try:
|
||||
add_success=False
|
||||
invite = DomainInvitation.objects.get(email=email, domain=self.object)
|
||||
# that invitation already existed
|
||||
if invite.status == DomainInvitation.DomainInvitationStatus.RETRIEVED:
|
||||
|
@ -880,7 +881,7 @@ class DomainAddUserView(DomainFormBaseView):
|
|||
def _make_invitation(self, email_address: str, requestor: User):
|
||||
"""Make a Domain invitation for this email and redirect with a message."""
|
||||
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:
|
||||
messages.warning(self.request, "Could not send email invitation.")
|
||||
else:
|
||||
|
@ -927,8 +928,8 @@ class DomainAddUserView(DomainFormBaseView):
|
|||
except IntegrityError:
|
||||
# User already has the desired role! Do nothing??
|
||||
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())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue