From 2872bbcf88a011656a462bd25bbcbcf47438b5e3 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Thu, 3 Sep 2026 17:46:51 +0200 Subject: [PATCH] Show message from determination for comments linked to determinations. --- .../templates/activity/ui/activity-comment-item.html | 6 +++++- hypha/apply/utils/templatetags/apply_tags.py | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hypha/apply/activity/templates/activity/ui/activity-comment-item.html b/hypha/apply/activity/templates/activity/ui/activity-comment-item.html index 97ee8cca2a..babdfdb3d4 100644 --- a/hypha/apply/activity/templates/activity/ui/activity-comment-item.html +++ b/hypha/apply/activity/templates/activity/ui/activity-comment-item.html @@ -44,7 +44,11 @@ {% if not submission_title and activity|user_can_see_related:request.user %} - {% blocktrans with related_name=activity.related_object|model_verbose_name|with_indefinite_article %}commented on {{ related_name }}{% endblocktrans %} + {% if activity.related_object|is_determination %} + {% trans "message from determination" %} + {% else %} + {% blocktrans with related_name=activity.related_object|model_verbose_name|with_indefinite_article %}commented on {{ related_name }}{% endblocktrans %} + {% endif %} {% else %} {% trans "commented" %} {% endif %} diff --git a/hypha/apply/utils/templatetags/apply_tags.py b/hypha/apply/utils/templatetags/apply_tags.py index eaaed98d5e..d79022fcee 100644 --- a/hypha/apply/utils/templatetags/apply_tags.py +++ b/hypha/apply/utils/templatetags/apply_tags.py @@ -39,6 +39,12 @@ def instance_verbose_name(instance): return model_verbose_name(instance) +@register.filter +def is_determination(instance): + Determination = apps.get_model("determinations", "Determination") + return isinstance(instance, Determination) + + @register.filter def format_number_as_currency(amount: float | decimal.Decimal | str | None): """Formats a number as currency"""