Merge pull request #13101 from shariquerik/patch-upadte-notification-channel

fix: Patch Update Notification channel
This commit is contained in:
mergify[bot] 2021-05-04 05:13:11 +00:00 committed by GitHub
commit ea85308321
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -336,3 +336,4 @@ frappe.patches.v13_0.remove_twilio_settings
frappe.patches.v12_0.rename_uploaded_files_with_proper_name
frappe.patches.v13_0.queryreport_columns
frappe.patches.v13_0.jinja_hook
frappe.patches.v13_0.update_notification_channel_if_empty

View file

@ -0,0 +1,15 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("Email", "doctype", "Notification")
notifications = frappe.get_all('Notification', {'is_standard': 1}, {'name', 'channel'})
for notification in notifications:
if not notification.channel:
frappe.db.set_value("Notification", notification.name, "channel", "Email", update_modified=False)
frappe.db.commit()