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

This commit is contained in:
Callum Fraser
2017-12-18 14:08:14 +00:00
committed by showell
parent b0c5eb5482
commit c55685063f

View File

@@ -13,9 +13,10 @@ from zerver.models import UserProfile
@api_key_only_webhook_view("AppFollow") @api_key_only_webhook_view("AppFollow")
@has_request_variables @has_request_variables
def api_appfollow_webhook(request, user_profile, stream=REQ(default="appfollow"), def api_appfollow_webhook(request: HttpRequest, user_profile: UserProfile,
topic=REQ(default=None), payload=REQ(argument_type="body")): stream: Text=REQ(default="appfollow"),
# type: (HttpRequest, UserProfile, Text, Optional[Text], Dict[str, Any]) -> HttpResponse topic: Optional[Text]=REQ(default=None),
payload: Dict[str, Any]=REQ(argument_type="body")) -> HttpResponse:
message = payload["text"] message = payload["text"]
app_name = re.search('\A(.+)', message).group(0) app_name = re.search('\A(.+)', message).group(0)
if topic is None: if topic is None: