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

import influxframework


def execute():
	"""Set default module for standard Web Template, if none."""
	influxframework.reload_doc("website", "doctype", "Web Template Field")
	influxframework.reload_doc("website", "doctype", "web_template")

	standard_templates = influxframework.get_list("Web Template", {"standard": 1})
	for template in standard_templates:
		doc = influxframework.get_doc("Web Template", template.name)
		if not doc.module:
			doc.module = "Website"
			doc.save()
