notification bot: Add constant for STREAM_EVENTS_NOTIFICATION_TOPIC.

This commit is contained in:
Rishi Gupta
2019-07-19 11:23:05 -07:00
committed by Tim Abbott
parent c9f194be99
commit 38eeb3e183
3 changed files with 3 additions and 2 deletions

View File

@@ -3564,7 +3564,7 @@ def do_rename_stream(stream: Stream,
stream.realm,
sender,
stream,
_('stream events'),
Realm.STREAM_EVENTS_NOTIFICATION_TOPIC,
_('@_**%(user_name)s|%(user_id)d** renamed stream **%(old_stream_name)s** to '
'**%(new_stream_name)s**.') % {
'user_name': user_profile.full_name,

View File

@@ -251,6 +251,7 @@ class Realm(models.Model):
DEFAULT_NOTIFICATION_STREAM_NAME = u'general'
INITIAL_PRIVATE_STREAM_NAME = u'core team'
STREAM_EVENTS_NOTIFICATION_TOPIC = _('stream events')
notifications_stream = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE) # type: Optional[Stream]
signup_notifications_stream = models.ForeignKey('Stream', related_name='+', null=True, blank=True, on_delete=CASCADE) # type: Optional[Stream]

View File

@@ -425,7 +425,7 @@ def add_subscriptions_backend(
realm=user_profile.realm,
sender=sender,
stream=stream,
topic=_('stream events'),
topic=Realm.STREAM_EVENTS_NOTIFICATION_TOPIC,
content=_('Stream created by @_**%(user_name)s|%(user_id)d**.') % {
'user_name': user_profile.full_name,
'user_id': user_profile.id}