notification_triggers: Reduce loose string usage.

This commit uses 'NotificationTriggers' class attributes
instead of directly using loose strings.

This should have been ideally included in the commit
c3319a5231.
This commit is contained in:
Prakhar Pratyush
2023-07-01 10:07:37 +05:30
committed by Tim Abbott
parent e2847790b6
commit e12cd9862a

View File

@@ -36,6 +36,7 @@ from zerver.lib.url_encoding import (
)
from zerver.models import (
Message,
NotificationTriggers,
Realm,
Recipient,
Stream,
@@ -524,7 +525,8 @@ def do_send_missedmessage_events_reply_in_zulip(
{
m["message"].sender
for m in missed_messages
if m["trigger"] == "mentioned" or m["trigger"] == "wildcard_mentioned"
if m["trigger"] == NotificationTriggers.MENTION
or m["trigger"] == NotificationTriggers.WILDCARD_MENTION
}
)
message = missed_messages[0]["message"]