fix: adds check before enabling notification settings
This commit is contained in:
parent
9e5ca78d78
commit
a8d11f23d8
1 changed files with 3 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue