From 4e9df28c12ed08d293399114f4c4d1ab40ca08f9 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 30 Oct 2012 15:02:28 -0400 Subject: [PATCH] send_message: Don't create streams automatically on send. (imported from commit 7be1b72c5fdf9a21167d2be3948cf1febf8da8ed) --- zephyr/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zephyr/views.py b/zephyr/views.py index 3ffe67ab06..24eb1b4588 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -633,7 +633,10 @@ def send_message_backend(request, user_profile, sender, client_name=None): # if not valid_stream_name(subject_name): # return json_error("Invalid subject name") - stream = create_stream_if_needed(user_profile.realm, stream_name) + try: + stream = Stream.objects.get(realm=user_profile.realm, name__iexact=stream_name) + except Stream.DoesNotExist: + return json_error("Stream does not exist") recipient = Recipient.objects.get(type_id=stream.id, type=Recipient.STREAM) elif message_type_name == 'personal': if "recipient" not in request.POST: