ソースを参照

fix: adds check before enabling notification settings

version-14
Parth Kharwar 4年前
コミット
a8d11f23d8
1個のファイルの変更3行の追加2行の削除
  1. +3
    -2
      frappe/desk/doctype/notification_settings/notification_settings.py

+ 3
- 2
frappe/desk/doctype/notification_settings/notification_settings.py ファイルの表示

@@ -44,7 +44,8 @@ def create_notification_settings(user):
_doc.insert(ignore_permissions=True)

def enable_disable_notifications(user, enabled):
frappe.set_value("Notification Settings", user, 'enabled', enabled)
if frappe.db.exists("Notification Settings", user):
frappe.set_value("Notification Settings", user, 'enabled', enabled)


@frappe.whitelist()
@@ -78,4 +79,4 @@ def get_permission_query_conditions(user):

@frappe.whitelist()
def set_seen_value(value, user):
frappe.db.set_value('Notification Settings', user, 'seen', value, update_modified=False)
frappe.db.set_value('Notification Settings', user, 'seen', value, update_modified=False)

読み込み中…
キャンセル
保存