mypy: Use Python 3 type syntax in zerver/views/alert_words.py.

This commit is contained in:
Kiy4h
2017-12-24 11:03:12 +07:00
committed by showell
parent 78e71faefe
commit 238cd2b132

View File

@@ -19,15 +19,15 @@ def clean_alert_words(alert_words: List[Text]) -> List[Text]:
return [w for w in alert_words if w != ""]
@has_request_variables
def add_alert_words(request, user_profile,
alert_words=REQ(validator=check_list(check_string), default=[])):
# type: (HttpRequest, UserProfile, List[Text]) -> HttpResponse
def add_alert_words(request: HttpRequest, user_profile: UserProfile,
alert_words: List[Text]=REQ(validator=check_list(check_string), default=[])
) -> HttpResponse:
do_add_alert_words(user_profile, clean_alert_words(alert_words))
return json_success()
@has_request_variables
def remove_alert_words(request, user_profile,
alert_words=REQ(validator=check_list(check_string), default=[])):
# type: (HttpRequest, UserProfile, List[Text]) -> HttpResponse
def remove_alert_words(request: HttpRequest, user_profile: UserProfile,
alert_words: List[Text]=REQ(validator=check_list(check_string), default=[])
) -> HttpResponse:
do_remove_alert_words(user_profile, alert_words)
return json_success()