groups: Pass old setting value for can_mention_group.

This commit adds support to pass object containing both old and new
values of the can_mention_group setting, as well as detailed API
documentation for this part of the API system.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
Co-authored-by: Greg PRice <greg@zulip.com>
This commit is contained in:
Sahil Batra
2024-05-02 19:22:23 +05:30
committed by Tim Abbott
parent 0cc2244aac
commit 8bca565218
9 changed files with 384 additions and 54 deletions

View File

@@ -52,6 +52,7 @@ class ErrorCode(Enum):
REMOTE_BILLING_UNAUTHENTICATED_USER = auto()
REMOTE_REALM_SERVER_MISMATCH_ERROR = auto()
PUSH_NOTIFICATIONS_DISALLOWED = auto()
EXPECTATION_MISMATCH = auto()
class JsonableError(Exception):
@@ -656,3 +657,15 @@ class TopicWildcardMentionNotAllowedError(JsonableError):
@override
def msg_format() -> str:
return _("You do not have permission to use topic wildcard mentions in this topic.")
class PreviousSettingValueMismatchedError(JsonableError):
code: ErrorCode = ErrorCode.EXPECTATION_MISMATCH
def __init__(self) -> None:
pass
@staticmethod
@override
def msg_format() -> str:
return _("'old' value does not match the expected value.")