Update add domain manager page content

This commit is contained in:
Erin Song 2024-09-26 10:43:32 -07:00
parent 42de7f2bb7
commit 8b61eb1275
No known key found for this signature in database
2 changed files with 9 additions and 7 deletions

View file

@ -19,8 +19,8 @@
{% endblock breadcrumb %}
<h1>Add a domain manager</h1>
<p>You can add another user to help manage your domain. They will need to sign
in to the .gov registrar with their Login.gov account.
<p>You can add another user to help manage your domain. If they aren't an organization member they will
need to sign in to the .gov registrar with their Login.gov account.
</p>
<form class="usa-form usa-form--large" method="post" novalidate>

View file

@ -823,15 +823,15 @@ class DomainAddUserView(DomainFormBaseView):
existing_org_invitation = PortfolioInvitation.objects.filter(email=email).first()
requestor_org = UserPortfolioPermission.objects.get(user=requestor).portfolio
print("Requestor org: ", requestor_org)
if (existing_org_permission and existing_org_permission.portfolio != requestor_org) or \
(existing_org_invitation and existing_org_invitation.portfolio != requestor_org):
add_success=False
if (existing_org_permission and existing_org_permission.portfolio != requestor_org) or (
existing_org_invitation and existing_org_invitation.portfolio != requestor_org
):
add_success = False
messages.error(
self.request,
f"That email is already a member of another .gov organization.",
)
raise Exception
# Check to see if an invite has already been sent
try:
@ -898,7 +898,9 @@ class DomainAddUserView(DomainFormBaseView):
else:
# if user already exists then just send an email
try:
self._send_domain_invitation_email(requested_email, requestor, requested_user=requested_user, add_success=False)
self._send_domain_invitation_email(
requested_email, requestor, requested_user=requested_user, add_success=False
)
except EmailSendingError:
logger.warn(
"Could not send email invitation (EmailSendingError)",