# Copyright (c) 2020, InfluxFramework LLC
# License: MIT. See LICENSE

import influxframework


def execute():

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

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