email mirror: Fix mypy annotation error.

This commit is contained in:
Tim Abbott 2017-04-24 22:01:48 -07:00
parent 556264f3d7
commit 1f0c4e5fb3
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ from __future__ import absolute_import
import ujson import ujson
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from typing import Dict
from zerver.decorator import internal_notify_view from zerver.decorator import internal_notify_view
from zerver.lib.email_mirror import mirror_email_message from zerver.lib.email_mirror import mirror_email_message
@ -17,7 +18,7 @@ def email_mirror_message(request, data=REQ(validator=check_dict([
('recipient', check_string), ('recipient', check_string),
('msg_text', check_string), ('msg_text', check_string),
]))): ]))):
# type: (HttpRequest) -> HttpResponse # type: (HttpRequest, Dict[str, str]) -> HttpResponse
result = mirror_email_message(ujson.loads(request.POST['data'])) result = mirror_email_message(ujson.loads(request.POST['data']))
if result["status"] == "error": if result["status"] == "error":
return json_error(result['msg']) return json_error(result['msg'])