Annotate circleci integration.

This commit is contained in:
Tim Abbott 2016-07-29 15:41:28 -07:00
parent 0ca7af6137
commit af823f7a76
1 changed files with 7 additions and 0 deletions

View File

@ -1,8 +1,14 @@
# Webhooks for external integrations.
from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from six import text_type
from typing import Any
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.models import UserProfile, Client
import ujson
@ -16,6 +22,7 @@ FAILED_STATUS = 'failed'
@has_request_variables
def api_circleci_webhook(request, user_profile, client, payload=REQ(argument_type='body'),
stream=REQ(default='circleci')):
# type: (HttpRequest, UserProfile, Client, Dict[str, Any], text_type) -> HttpResponse
payload = payload['payload']
subject = get_subject(payload)
body = get_body(payload)