|
|
""" Computes if the current body is the same as the one from template.
Both real and sanitized values are considered, to avoid editor issues
as much as possible. """
for composer_mixin in self:
if not tools.is_html_empty(composer_mixin.body) and composer_mixin.template_id:
template_value = composer_mixin.template_id.body_html
sanitized_template_value = tools.html_sanitize(template_value)
composer_mixin.body_has_template_value = composer_mixin.body in (template_value, sanitized_template_value)
else:
composer_mixin.body_has_template_value = False
|
|