push_notifications: Guard reference to RemotePushDevice.

This doesn’t exist when ZILENCER_ENABLED is False.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2025-08-05 01:25:59 -07:00
committed by Tim Abbott
parent 68b205775e
commit 88b9a2cfbd

View File

@@ -256,7 +256,7 @@ def get_info_from_apns_result(
logger.info(
"APNs: Removing invalid/expired token %s (%s)", device.token, result.description
)
if isinstance(device, RemotePushDevice):
if settings.ZILENCER_ENABLED and isinstance(device, RemotePushDevice):
result_info.delete_device_id = device.device_id
else:
result_info.delete_device_token = device.token