Skip to content

Commit

Permalink
Merge pull request #886 from The-Commit-Company/develop
Browse files Browse the repository at this point in the history
fix: trigger ORM update when changing notification setting
  • Loading branch information
nikkothari22 authored Apr 23, 2024
2 parents 1a31a26 + 8ea3654 commit 2a009e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion raven/api/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def are_push_notifications_enabled() -> bool:
@frappe.whitelist(methods=["POST"])
def toggle_push_notification_for_channel(member: str, allow_notifications: 0 | 1) -> None:
if are_push_notifications_enabled():
frappe.db.set_value("Raven Channel Member", member, "allow_notifications", allow_notifications)
member_doc = frappe.get_doc("Raven Channel Member", member)
if member_doc:
member_doc.allow_notifications = allow_notifications
member_doc.save()
else:
frappe.throw("Push notifications are not supported in the current framework version")

0 comments on commit 2a009e9

Please sign in to comment.