diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py index f525e63dd6..4bc6d060ee 100644 --- a/zerver/lib/push_notifications.py +++ b/zerver/lib/push_notifications.py @@ -357,8 +357,8 @@ def add_push_device_token(user_profile, token_str, kind, ios_app_id=None): token.last_updated = timezone.now() token.save(update_fields=['last_updated']) -def remove_push_device_token(request, user_profile, token_str, kind): - # type: (HttpRequest, UserProfile, str, int) -> None +def remove_push_device_token(user_profile, token_str, kind): + # type: (UserProfile, str, int) -> None try: token = PushDeviceToken.objects.get(token=token_str, kind=kind) token.delete() diff --git a/zerver/views/push_notifications.py b/zerver/views/push_notifications.py index d7fb26c3b1..14a4414549 100644 --- a/zerver/views/push_notifications.py +++ b/zerver/views/push_notifications.py @@ -37,12 +37,12 @@ def add_android_reg_id(request, user_profile, token=REQ()): def remove_apns_device_token(request, user_profile, token=REQ()): # type: (HttpRequest, UserProfile, str) -> HttpResponse validate_token(token) - remove_push_device_token(request, user_profile, token, PushDeviceToken.APNS) + remove_push_device_token(user_profile, token, PushDeviceToken.APNS) return json_success() @has_request_variables def remove_android_reg_id(request, user_profile, token=REQ()): # type: (HttpRequest, UserProfile, str) -> HttpResponse validate_token(token) - remove_push_device_token(request, user_profile, token, PushDeviceToken.GCM) + remove_push_device_token(user_profile, token, PushDeviceToken.GCM) return json_success()