mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-20 00:14:16 +02:00
error cleanup
This commit is contained in:
parent
7bbee19bfe
commit
5cb6c3f0fb
3 changed files with 0 additions and 22 deletions
|
@ -5,8 +5,6 @@ from registrar.models.user_portfolio_permission import UserPortfolioPermission
|
||||||
from registrar.utility.errors import (
|
from registrar.utility.errors import (
|
||||||
AlreadyDomainInvitedError,
|
AlreadyDomainInvitedError,
|
||||||
AlreadyDomainManagerError,
|
AlreadyDomainManagerError,
|
||||||
AlreadyPortfolioInvitedError,
|
|
||||||
AlreadyPortfolioMemberError,
|
|
||||||
MissingEmailError,
|
MissingEmailError,
|
||||||
OutsideOrgMemberError,
|
OutsideOrgMemberError,
|
||||||
)
|
)
|
||||||
|
|
|
@ -43,20 +43,6 @@ class AlreadyDomainInvitedError(InvitationError):
|
||||||
super().__init__(f"{email} has already been invited to this domain.")
|
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):
|
class MissingEmailError(InvitationError):
|
||||||
"""Raised when the requestor has no email associated with their account."""
|
"""Raised when the requestor has no email associated with their account."""
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,6 @@ from registrar.utility.enums import DefaultEmail
|
||||||
from registrar.utility.errors import (
|
from registrar.utility.errors import (
|
||||||
AlreadyDomainInvitedError,
|
AlreadyDomainInvitedError,
|
||||||
AlreadyDomainManagerError,
|
AlreadyDomainManagerError,
|
||||||
AlreadyPortfolioInvitedError,
|
|
||||||
AlreadyPortfolioMemberError,
|
|
||||||
GenericError,
|
GenericError,
|
||||||
GenericErrorCodes,
|
GenericErrorCodes,
|
||||||
MissingEmailError,
|
MissingEmailError,
|
||||||
|
@ -1334,10 +1332,6 @@ class DomainAddUserView(DomainFormBaseView):
|
||||||
if isinstance(exception, EmailSendingError):
|
if isinstance(exception, EmailSendingError):
|
||||||
logger.warning("Could not send email invitation (EmailSendingError)", portfolio, exc_info=True)
|
logger.warning("Could not send email invitation (EmailSendingError)", portfolio, exc_info=True)
|
||||||
messages.warning(self.request, "Could not send email invitation.")
|
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):
|
elif isinstance(exception, MissingEmailError):
|
||||||
messages.error(self.request, str(exception))
|
messages.error(self.request, str(exception))
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue