mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
ruff: Fix PYI019 Use Self instead of custom TypeVar.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
7cbda7d7a5
commit
88a8087243
@@ -12,7 +12,7 @@ from collections import defaultdict
|
||||
from collections.abc import Iterator
|
||||
from datetime import datetime, timezone
|
||||
from email.headerregistry import Address
|
||||
from typing import Any, TypeAlias, TypeVar
|
||||
from typing import Any, TypeAlias
|
||||
from urllib.parse import SplitResult, urlsplit
|
||||
|
||||
import orjson
|
||||
@@ -68,8 +68,6 @@ AddedChannelsT: TypeAlias = dict[str, tuple[str, int]]
|
||||
AddedMPIMsT: TypeAlias = dict[str, tuple[str, int]]
|
||||
DMMembersT: TypeAlias = dict[str, tuple[str, str]]
|
||||
SlackToZulipRecipientT: TypeAlias = dict[str, int]
|
||||
# Generic type for SlackBotEmail class
|
||||
SlackBotEmailT = TypeVar("SlackBotEmailT", bound="SlackBotEmail")
|
||||
|
||||
# We can look up unicode codepoints for Slack emoji using iamcal emoji
|
||||
# data. https://emojipedia.org/slack/, documents Slack's emoji names
|
||||
@@ -106,7 +104,7 @@ class SlackBotEmail:
|
||||
assigned_email: dict[str, str] = {}
|
||||
|
||||
@classmethod
|
||||
def get_email(cls: type[SlackBotEmailT], user_profile: ZerverFieldsT, domain_name: str) -> str:
|
||||
def get_email(cls, user_profile: ZerverFieldsT, domain_name: str) -> str:
|
||||
slack_bot_id = user_profile["bot_id"]
|
||||
if slack_bot_id in cls.assigned_email:
|
||||
return cls.assigned_email[slack_bot_id]
|
||||
|
||||
Reference in New Issue
Block a user