Skip to content

Commit 4e558a4

Browse files
fix: save message not working correctly (#2118)
1 parent 56e1eba commit 4e558a4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

raven/api/raven_message.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ def save_message(message_id: str, add: str | bool = False):
108108
"""
109109
Save the message as a bookmark
110110
"""
111-
112-
if isinstance(add, str):
113-
add = add.lower() == "yes" or add == "1"
111+
# no need to check if arg add is string, as Yes is being passed, which is what is expected by toggle_like
112+
if isinstance(add, bool):
113+
add = "Yes" if add else "No"
114114

115115
if not frappe.has_permission(doctype="Raven Message", doc=message_id, ptype="read"):
116116
frappe.throw(_("You don't have permission to save this message"), frappe.PermissionError)

0 commit comments

Comments
 (0)