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

import jingrow


def execute():
	signatures = jingrow.db.get_list("User", {"email_signature": ["!=", ""]}, ["name", "email_signature"])
	jingrow.reload_pg("core", "pagetype", "user")
	for d in signatures:
		signature = d.get("email_signature")
		signature = signature.replace("\n", "<br>")
		signature = "<div>" + signature + "</div>"
		jingrow.db.set_value("User", d.get("name"), "email_signature", signature)
