Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
user_topics: Properly type mute_cond with TypedDict.
Zixuan James Li88f6f3fc0f9b
diff --git a/zerver/lib/user_topics.py b/zerver/lib/user_topics.pyindex 18595a8ad86..1be90da4c67 100644--- a/zerver/lib/user_topics.py+++ b/zerver/lib/user_topics.py@@ -1,5 +1,5 @@import datetime-from typing import Any, Callable, Dict, List, Optional, Tuple+from typing import Callable, List, Optional, Tuple, TypedDictfrom django.db.models.query import QuerySetfrom django.utils.timezone import now as timezone_now@@ -131,7 +131,11 @@ def exclude_topic_mutes(if not rows:return conditions- def mute_cond(row: Dict[str, Any]) -> ClauseElement:+ class RecipientTopicDict(TypedDict):+ recipient_id: int+ topic_name: str++ def mute_cond(row: RecipientTopicDict) -> ClauseElement:recipient_id = row["recipient_id"]topic_name = row["topic_name"]stream_cond = column("recipient_id", Integer) == recipient_id