error cleanup

This commit is contained in:
David Kennedy 2024-12-16 22:59:26 -05:00
parent 7bbee19bfe
commit 5cb6c3f0fb
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
3 changed files with 0 additions and 22 deletions

View file

@ -5,8 +5,6 @@ from registrar.models.user_portfolio_permission import UserPortfolioPermission
from registrar.utility.errors import (
AlreadyDomainInvitedError,
AlreadyDomainManagerError,
AlreadyPortfolioInvitedError,
AlreadyPortfolioMemberError,
MissingEmailError,
OutsideOrgMemberError,
)

View file

@ -43,20 +43,6 @@ class AlreadyDomainInvitedError(InvitationError):
super().__init__(f"{email} has already been invited to this domain.")
class AlreadyPortfolioMemberError(InvitationError):
"""Raised when the user is already a member of the portfolio."""
def __init__(self, email):
super().__init__(f"{email} is already a manager for this portfolio.")
class AlreadyPortfolioInvitedError(InvitationError):
"""Raised when the user has already been invited to the portfolio."""
def __init__(self, email, portfolio):
super().__init__(f"{email} has already been invited to {portfolio}.")
class MissingEmailError(InvitationError):
"""Raised when the requestor has no email associated with their account."""

View file

@ -33,8 +33,6 @@ from registrar.utility.enums import DefaultEmail
from registrar.utility.errors import (
AlreadyDomainInvitedError,
AlreadyDomainManagerError,
AlreadyPortfolioInvitedError,
AlreadyPortfolioMemberError,
GenericError,
GenericErrorCodes,
MissingEmailError,
@ -1334,10 +1332,6 @@ class DomainAddUserView(DomainFormBaseView):
if isinstance(exception, EmailSendingError):
logger.warning("Could not send email invitation (EmailSendingError)", portfolio, exc_info=True)
messages.warning(self.request, "Could not send email invitation.")
elif isinstance(exception, AlreadyPortfolioMemberError):
messages.warning(self.request, str(exception))
elif isinstance(exception, AlreadyPortfolioInvitedError):
messages.warning(self.request, str(exception))
elif isinstance(exception, MissingEmailError):
messages.error(self.request, str(exception))
logger.error(