mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 04:12:02 +00:00
exceptions: Move InvitationError to zerver/lib/exceptions.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from enum import Enum
|
||||
from typing import Any, Dict, List, NoReturn, Optional, Type, TypeVar
|
||||
from typing import Any, Dict, List, NoReturn, Optional, Tuple, Type, TypeVar
|
||||
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
@@ -358,3 +358,15 @@ class InvalidSubdomainError(JsonableError):
|
||||
class ZephyrMessageAlreadySentException(Exception):
|
||||
def __init__(self, message_id: int) -> None:
|
||||
self.message_id = message_id
|
||||
|
||||
|
||||
class InvitationError(JsonableError):
|
||||
code = ErrorCode.INVITATION_FAILED
|
||||
data_fields = ["errors", "sent_invitations"]
|
||||
|
||||
def __init__(
|
||||
self, msg: str, errors: List[Tuple[str, str, bool]], sent_invitations: bool
|
||||
) -> None:
|
||||
self._msg: str = msg
|
||||
self.errors: List[Tuple[str, str, bool]] = errors
|
||||
self.sent_invitations: bool = sent_invitations
|
||||
|
||||
Reference in New Issue
Block a user