mypy: Use Python 3 type syntax in `zerver/webhooks/mention/view.py`.

This commit is contained in:
Marco Burstein 2017-12-19 09:52:03 -08:00 committed by showell
parent 017476cdfb
commit 2acf3cf1d4
1 changed files with 4 additions and 5 deletions

View File

@ -13,11 +13,10 @@ from zerver.models import UserProfile
@api_key_only_webhook_view('Mention') @api_key_only_webhook_view('Mention')
@has_request_variables @has_request_variables
def api_mention_webhook(request, user_profile, def api_mention_webhook(request: HttpRequest, user_profile: UserProfile,
payload=REQ(argument_type='body'), payload: Dict[str, Iterable[Dict[str, Any]]] = REQ(argument_type='body'),
stream=REQ(default='mention'), stream: Text = REQ(default='mention'),
topic=REQ(default='news')): topic: Optional[Text] = REQ(default='news')) -> HttpResponse:
# type: (HttpRequest, UserProfile, Dict[str, Iterable[Dict[str, Any]]], Text, Optional[Text]) -> HttpResponse
title = payload["title"] title = payload["title"]
source_url = payload["url"] source_url = payload["url"]
description = payload["description"] description = payload["description"]