Fix bug #1186: Fixed emails sent when a wiki page is updated

remotes/origin/enhancement/email-actions
David Barragán Merino 2014-10-07 15:06:20 +02:00
parent 55c3e0c7cf
commit 674902eb7d
4 changed files with 22 additions and 3 deletions

View File

@ -111,6 +111,15 @@ class HistoryEntry(models.Model):
if description_diff:
key = "description_diff"
value = (None, description_diff)
elif key == "content":
content_diff = get_diff_of_htmls(
self.diff[key][0],
self.diff[key][1]
)
if content_diff:
key = "content_diff"
value = (None, content_diff)
elif key in users_keys:
value = [resolve_value("users", x) for x in self.diff[key]]
elif key == "watchers":

View File

@ -1,6 +1,8 @@
{% set excluded_fields = [
"description",
"description_html"
"description_html",
"content",
"content_html"
] %}
<dl>
@ -94,7 +96,12 @@
{# DESCRIPTIONS #}
{% elif field_name in ["description_diff"] %}
<dd style="background: #eee; padding: 5px 15px; color: #444">
<b>to:</b> <i>{{ mdrender(object.project, values.1) }}</i>
<b>diff:</b> <i>{{ mdrender(object.project, values.1) }}</i>
</dd>
{# CONTENT #}
{% elif field_name in ["content_diff"] %}
<dd style="background: #eee; padding: 5px 15px; color: #444">
<b>diff:</b> <i>{{ mdrender(object.project, values.1) }}</i>
</dd>
{# ASSIGNED TO #}
{% elif field_name == "assigned_to" %}

View File

@ -1,6 +1,8 @@
{% set excluded_fields = [
"description_diff",
"description_html"
"description_html",
"content_diff",
"content_html"
] %}
{% for field_name, values in changed_fields.items() %}
{% if field_name not in excluded_fields %}

View File

@ -23,6 +23,7 @@ register = library.Library()
EXTRA_FIELD_VERBOSE_NAMES = {
"description_diff": _("description"),
"content_diff": _("content")
}