2021-04-16 00:57:30 +02:00
|
|
|
from django.utils.translation import gettext as _
|
2023-10-12 19:43:45 +02:00
|
|
|
from typing_extensions import override
|
2017-07-21 02:20:31 +02:00
|
|
|
|
2017-11-16 00:53:11 +01:00
|
|
|
from zerver.lib.exceptions import ErrorCode, JsonableError
|
2017-07-21 02:20:31 +02:00
|
|
|
|
2020-06-11 00:54:34 +02:00
|
|
|
|
2017-07-21 02:20:31 +02:00
|
|
|
class BadEventQueueIdError(JsonableError):
|
|
|
|
code = ErrorCode.BAD_EVENT_QUEUE_ID
|
2021-02-12 08:20:45 +01:00
|
|
|
data_fields = ["queue_id"]
|
2017-07-21 02:20:31 +02:00
|
|
|
|
2018-05-10 19:13:36 +02:00
|
|
|
def __init__(self, queue_id: str) -> None:
|
python: Convert assignment type annotations to Python 3.6 style.
This commit was split by tabbott; this piece covers the vast majority
of files in Zulip, but excludes scripts/, tools/, and puppet/ to help
ensure we at least show the right error messages for Xenial systems.
We can likely further refine the remaining pieces with some testing.
Generated by com2ann, with whitespace fixes and various manual fixes
for runtime issues:
- invoiced_through: Optional[LicenseLedger] = models.ForeignKey(
+ invoiced_through: Optional["LicenseLedger"] = models.ForeignKey(
-_apns_client: Optional[APNsClient] = None
+_apns_client: Optional["APNsClient"] = None
- notifications_stream: Optional[Stream] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
- signup_notifications_stream: Optional[Stream] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
+ notifications_stream: Optional["Stream"] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
+ signup_notifications_stream: Optional["Stream"] = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE)
- author: Optional[UserProfile] = models.ForeignKey('UserProfile', blank=True, null=True, on_delete=CASCADE)
+ author: Optional["UserProfile"] = models.ForeignKey('UserProfile', blank=True, null=True, on_delete=CASCADE)
- bot_owner: Optional[UserProfile] = models.ForeignKey('self', null=True, on_delete=models.SET_NULL)
+ bot_owner: Optional["UserProfile"] = models.ForeignKey('self', null=True, on_delete=models.SET_NULL)
- default_sending_stream: Optional[Stream] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
- default_events_register_stream: Optional[Stream] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
+ default_sending_stream: Optional["Stream"] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
+ default_events_register_stream: Optional["Stream"] = models.ForeignKey('zerver.Stream', null=True, related_name='+', on_delete=CASCADE)
-descriptors_by_handler_id: Dict[int, ClientDescriptor] = {}
+descriptors_by_handler_id: Dict[int, "ClientDescriptor"] = {}
-worker_classes: Dict[str, Type[QueueProcessingWorker]] = {}
-queues: Dict[str, Dict[str, Type[QueueProcessingWorker]]] = {}
+worker_classes: Dict[str, Type["QueueProcessingWorker"]] = {}
+queues: Dict[str, Dict[str, Type["QueueProcessingWorker"]]] = {}
-AUTH_LDAP_REVERSE_EMAIL_SEARCH: Optional[LDAPSearch] = None
+AUTH_LDAP_REVERSE_EMAIL_SEARCH: Optional["LDAPSearch"] = None
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-22 01:09:50 +02:00
|
|
|
self.queue_id: str = queue_id
|
2017-07-21 02:20:31 +02:00
|
|
|
|
|
|
|
@staticmethod
|
2023-10-12 19:43:45 +02:00
|
|
|
@override
|
2018-05-10 19:13:36 +02:00
|
|
|
def msg_format() -> str:
|
2022-11-29 20:03:31 +01:00
|
|
|
return _("Bad event queue ID: {queue_id}")
|