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

This commit is contained in:
Kiy4h 2017-12-24 11:04:09 +07:00 committed by showell
parent 64413e3b91
commit 6fa51be822
1 changed files with 4 additions and 3 deletions

View File

@ -28,9 +28,10 @@ def validate_token(token_str: bytes, kind: int) -> None:
@human_users_only
@has_request_variables
def add_apns_device_token(request, user_profile, token=REQ(),
appid=REQ(default=settings.ZULIP_IOS_APP_ID)):
# type: (HttpRequest, UserProfile, bytes, str) -> HttpResponse
def add_apns_device_token(request: HttpRequest, user_profile: UserProfile,
token: bytes=REQ(),
appid: str=REQ(default=settings.ZULIP_IOS_APP_ID)
) -> HttpResponse:
validate_token(token, PushDeviceToken.APNS)
add_push_device_token(user_profile, token, PushDeviceToken.APNS, ios_app_id=appid)
return json_success()