Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

email_notifications: Remove the stale `stream_message` field.

Prakhar Pratyushf8b251073a70
diff --git a/zerver/lib/email_notifications.py b/zerver/lib/email_notifications.py
index a9552835815..a900098e226 100644
--- a/zerver/lib/email_notifications.py
+++ b/zerver/lib/email_notifications.py
@@ -345,7 +345,6 @@ def build_message_list(
"grouping": grouping,
"plain": header,
"html": header_html,
- "stream_message": message.recipient.type_name() == "stream",
}
# # Collapse message list to
diff --git a/zerver/models/recipients.py b/zerver/models/recipients.py
index 632151ba58b..ab18c916877 100644
--- a/zerver/models/recipients.py
+++ b/zerver/models/recipients.py
@@ -55,13 +55,6 @@ class Recipient(models.Model):
class Meta:
unique_together = ("type", "type_id")
- # N.B. If we used Django's choice=... we would get this for free (kinda)
- _type_names = {
- PERSONAL: "personal",
- STREAM: "stream",
- DIRECT_MESSAGE_GROUP: "direct_message_group",
- }
-
@override
def __str__(self) -> str:
return f"{self.label()} ({self.type_id}, {self.type})"
@@ -74,10 +67,6 @@ class Recipient(models.Model):
else:
return str(get_display_recipient(self))
- def type_name(self) -> str:
- # Raises KeyError if invalid
- return self._type_names[self.type]
-
def get_direct_message_group_user_ids(recipient: Recipient) -> QuerySet["Subscription", int]:
from zerver.models import Subscription
diff --git a/zerver/tests/test_service_bot_system.py b/zerver/tests/test_service_bot_system.py
index cf2045c4459..3f845088772 100644
--- a/zerver/tests/test_service_bot_system.py
+++ b/zerver/tests/test_service_bot_system.py
@@ -490,7 +490,7 @@ class TestServiceBotEventTriggers(ZulipTestCase):
content = "@**FooBot** foo bar!!!"
recipient = "Denmark"
trigger = "mention"
- recipient_type = Recipient._type_names[Recipient.STREAM]
+ recipient_type = "stream"
def check_values_passed(
queue_name: Any,