From 8099aa54706dc4a99d9929857574bbd9bdec466b Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 28 Dec 2015 12:48:30 -0800 Subject: [PATCH] Fix passing notifications_stream to set_default_streams. Previously, this would throw an IntegrityError, because it had just been added in the loop. --- zerver/lib/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 6e6d6cc9bf..fe4519cf64 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -1862,7 +1862,7 @@ def set_default_streams(realm, stream_names): # Always include the realm's default notifications streams, if it exists if realm.notifications_stream is not None: - DefaultStream.objects.create(stream=realm.notifications_stream, realm=realm) + DefaultStream.objects.get_or_create(stream=realm.notifications_stream, realm=realm) log_event({'type': 'default_streams', 'domain': realm.domain,