mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 04:23:46 +00:00
push_notifs: Make appid required on add_apns_device_token.
We're going to need to use this information, so we shouldn't just assume a value; the client should tell us the actual value. Conveniently, the Zulip mobile app does already pass this parameter and has since forever. So we can just start requiring it, with no compatibility constraint.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from typing import Optional
|
||||
|
||||
from django.conf import settings
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
@@ -35,7 +34,7 @@ def add_apns_device_token(
|
||||
request: HttpRequest,
|
||||
user_profile: UserProfile,
|
||||
token: str = REQ(),
|
||||
appid: str = REQ(default=settings.ZULIP_IOS_APP_ID),
|
||||
appid: str = REQ(),
|
||||
) -> HttpResponse:
|
||||
validate_token(token, PushDeviceToken.APNS)
|
||||
add_push_device_token(user_profile, token, PushDeviceToken.APNS, ios_app_id=appid)
|
||||
|
||||
Reference in New Issue
Block a user