From 2bd0026d497a334f669a661baf558eb42c7bd510 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 10 Mar 2020 11:33:08 +0000 Subject: [PATCH] Added get_comment overridable method to TaskState --- .../wagtailadmin/pages/workflow_history/detail.html | 4 ++++ wagtail/core/models.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/wagtail/admin/templates/wagtailadmin/pages/workflow_history/detail.html b/wagtail/admin/templates/wagtailadmin/pages/workflow_history/detail.html index 99920376bd..665c25c54e 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/workflow_history/detail.html +++ b/wagtail/admin/templates/wagtailadmin/pages/workflow_history/detail.html @@ -83,6 +83,8 @@ {% else %}
{{ task_state.get_status_display }}
{% endif %} + +

{{ task_state.specific.get_comment }}

{% endfor %} @@ -126,6 +128,8 @@ {% else %}
{{ timeline_item.task_state.get_status_display }}
{% endif %} + +

{{ task_state.specific.get_comment }}

{% endif %} diff --git a/wagtail/core/models.py b/wagtail/core/models.py index fbedce28fa..b974deb4f3 100644 --- a/wagtail/core/models.py +++ b/wagtail/core/models.py @@ -3066,6 +3066,15 @@ class TaskState(MultiTableCopyMixin, models.Model): instance.save() return instance + def get_comment(self): + """ + Returns a string that is displayed in workflow history. + + This could be a comment by the reviewer, or generated. + Use mark_safe to return HTML. + """ + return "" + class Meta: verbose_name = _('Task state') verbose_name_plural = _('Task states')