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

import xhiveframework


def execute():
	xhiveframework.reload_doc("website", "doctype", "website_theme_ignore_app")
	themes = xhiveframework.get_all("Website Theme", filters={"theme_url": ("not like", "/files/website_theme/%")})
	for theme in themes:
		doc = xhiveframework.get_doc("Website Theme", theme.name)
		try:
			doc.save()
		except Exception:
			print("Ignoring....")
			print(xhiveframework.get_traceback())
