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

import influxframework


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