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')
@has_request_variables
def api_mention_webhook(request, user_profile,
payload=REQ(argument_type='body'),
stream=REQ(default='mention'),
topic=REQ(default='news')):
# type: (HttpRequest, UserProfile, Dict[str, Iterable[Dict[str, Any]]], Text, Optional[Text]) -> HttpResponse
def api_mention_webhook(request: HttpRequest, user_profile: UserProfile,
payload: Dict[str, Iterable[Dict[str, Any]]] = REQ(argument_type='body'),
stream: Text = REQ(default='mention'),
topic: Optional[Text] = REQ(default='news')) -> HttpResponse:
title = payload["title"]
source_url = payload["url"]
description = payload["description"]