From d20b57c20dc1350c456307e2aa6c3c0700fc4983 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Mon, 2 Oct 2017 02:54:32 -0230 Subject: [PATCH] webhooks/teamcity: Migrate to check_send_private_message. --- zerver/webhooks/teamcity/view.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zerver/webhooks/teamcity/view.py b/zerver/webhooks/teamcity/view.py index f6f0559e9f..a70c8eeac1 100644 --- a/zerver/webhooks/teamcity/view.py +++ b/zerver/webhooks/teamcity/view.py @@ -5,7 +5,7 @@ from django.http import HttpRequest, HttpResponse from typing import Any, Dict, List, Optional from zerver.models import UserProfile, Realm -from zerver.lib.actions import check_send_message, check_send_stream_message +from zerver.lib.actions import check_send_private_message, check_send_stream_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view @@ -93,7 +93,8 @@ def api_teamcity_webhook(request, user_profile, payload=REQ(argument_type='body' return json_success() body = "Your personal build of " + body - check_send_message(user_profile, request.client, 'private', [teamcity_user.email], topic, body) + check_send_private_message(user_profile, request.client, teamcity_user, body) + return json_success() check_send_stream_message(user_profile, request.client, stream, topic, body)