mirror of https://github.com/zulip/zulip.git
streams: Fix default streams list not updating on deactivation.
If you deactivated a default stream, we would correctly remove it from the list of default streams in the organization. However, we did not call `send_event`, so browsers would still display it as a default stream until the next reload. This fixes that issue by calling do_remove_default_stream instead of doing the database query directly.
This commit is contained in:
parent
eb25c6be87
commit
d21756c396
|
@ -585,7 +585,10 @@ def do_deactivate_stream(stream, log=True):
|
|||
stream.name = new_name[:Stream.MAX_NAME_LENGTH]
|
||||
stream.save()
|
||||
|
||||
DefaultStream.objects.filter(realm=stream.realm, stream=stream).delete()
|
||||
# If this is a default stream, remove it, properly sending a
|
||||
# notification to browser clients.
|
||||
if DefaultStream.objects.filter(realm=stream.realm, stream=stream).exists():
|
||||
do_remove_default_stream(stream)
|
||||
|
||||
# Remove the old stream information from remote cache.
|
||||
old_cache_key = get_stream_cache_key(old_name, stream.realm)
|
||||
|
|
Loading…
Reference in New Issue