message: Use .is_channel_message column instead of is_stream_message().

This avoids a potential unnecessary message.recipient fetch required by
is_stream_message(). is_stream_message() methods precedes the addition
of the denormalized is_channel_message column and is now unnecessary.

In practice, we usually fetch Message objects with `.recipient` already,
so I don't expect any notable performance impact here - but it's still a
useful change to make.
This commit is contained in:
Mateusz Mandera
2025-08-17 03:25:23 +08:00
committed by Tim Abbott
parent 4e3ec77a0f
commit 51cef01c29
18 changed files with 41 additions and 44 deletions

View File

@@ -2775,6 +2775,7 @@ class PushNotificationTestCase(BouncerTestCase):
rendered_content="This is test content",
date_sent=timezone_now(),
sending_client=self.sending_client,
is_channel_message=type == Recipient.STREAM,
)
message.set_topic_name("Test topic")
message.save()