# Copyright (c) 2020, JINGROW and Contributors
# License: MIT. See LICENSE

import jingrow


def execute():
	"""Set default module for standard Web Template, if none."""
	jingrow.reload_pg("website", "pagetype", "Web Template Field")
	jingrow.reload_pg("website", "pagetype", "web_template")

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