From 46a57e37aaf27c0dd6148a7c262639e5055adc22 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 5 Jun 2024 05:26:05 +0000 Subject: [PATCH] push_notifications: Support test notifications from old servers. 4430ab9cbee8 changed this, assuming that all servers would send `realm_url` -- however, only servers running that commit do. Update to accept either `realm_url` or `realm_uri` payload properties. --- zerver/lib/push_notifications.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py index 146e027058..35f629e13f 100644 --- a/zerver/lib/push_notifications.py +++ b/zerver/lib/push_notifications.py @@ -1449,7 +1449,8 @@ def send_test_push_notification_directly_to_devices( apple_payload = copy.deepcopy(payload) android_payload = copy.deepcopy(payload) - realm_url = base_payload["realm_url"] + # TODO/compatibility: Backwards-compatibility name for realm_url. + realm_url = base_payload.get("realm_url", base_payload["realm_uri"]) realm_name = base_payload["realm_name"] apns_data = { "alert": {