streams: Fix empty description in stream change notifications.

Send 'No description' text when either the old or new stream
description is empty, to avoid odd looking notifications.
This commit is contained in:
jai2201
2022-03-29 11:55:03 +05:30
committed by Tim Abbott
parent c789097184
commit 20e6315705
2 changed files with 49 additions and 0 deletions

View File

@@ -5455,6 +5455,11 @@ def send_change_stream_description_notification(
user_mention = silent_mention_syntax_for_user(acting_user)
with override_language(stream.realm.default_language):
if new_description == "":
new_description = "*" + _("No description.") + "*"
if old_description == "":
old_description = "*" + _("No description.") + "*"
notification_string = (
_("{user} changed the description for this stream.").format(user=user_mention)
+ "\n\n* **"