Fix passing notifications_stream to set_default_streams.

Previously, this would throw an IntegrityError, because it had just
been added in the loop.
This commit is contained in:
Tim Abbott 2015-12-28 12:48:30 -08:00
parent c661bc17fb
commit 8099aa5470
1 changed files with 1 additions and 1 deletions

View File

@ -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,