From 6d9d4f9e8626a9640eaa5ec9528d21a345144369 Mon Sep 17 00:00:00 2001 From: Tarun Pratap Singh <101409098+tarunps@users.noreply.github.com> Date: Thu, 10 Apr 2025 12:47:30 +0530 Subject: [PATCH] fix(push_notification): use cstr to convert a None body to empty string (#32056) --- frappe/push_notification.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/push_notification.py b/frappe/push_notification.py index 861b49dfa0..6e6d2585c3 100644 --- a/frappe/push_notification.py +++ b/frappe/push_notification.py @@ -3,6 +3,7 @@ from urllib.parse import urlparse import frappe from frappe import sbool +from frappe.utils.data import cstr from frappe.utils.response import Response from .frappeclient import FrappeClient @@ -117,6 +118,7 @@ class PushNotification: data["click_action"] = link if icon: data["notification_icon"] = icon + body = cstr(body) if len(body) > 1000: if truncate_body: body = body[:1000] @@ -161,6 +163,7 @@ class PushNotification: data["click_action"] = link if icon: data["notification_icon"] = icon + body = cstr(body) if len(body) > 1000: if truncate_body: body = body[:1000]