# Copyright (c) 2020, XhiveFramework Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE

import xhiveframework


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

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