# Copyright (c) 2020, Xhive Global Ltd. and Contributors
# License: MIT. See LICENSE

import xhiveframework


def execute():

	xhiveframework.reload_doc("Email", "doctype", "Notification")

	notifications = xhiveframework.get_all("Notification", {"is_standard": 1}, {"name", "channel"})
	for notification in notifications:
		if not notification.channel:
			xhiveframework.db.set_value(
				"Notification", notification.name, "channel", "Email", update_modified=False
			)
			xhiveframework.db.commit()
