diff --git a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc index 4541d350..73457085 100644 Binary files a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc differ diff --git a/osinaweb/osinacore/models.py b/osinaweb/osinacore/models.py index e10ff5e1..4827cf84 100644 --- a/osinaweb/osinacore/models.py +++ b/osinaweb/osinacore/models.py @@ -452,6 +452,15 @@ class Status(models.Model): else: return self.date_time.strftime('%d %m %Y, %I:%M %p') + @property + def project(self): + if self.type == 'Task' and self.type_id: + try: + task = Task.objects.get(id=self.type_id) + return task.project.id + except Task.DoesNotExist: + return None + return None @receiver(post_save, sender=Status) def new_ticket_update_handler(sender, instance, created, **kwargs): diff --git a/osinaweb/osinacore/templates/details_templates/partials/new-status-activity.html b/osinaweb/osinacore/templates/details_templates/partials/new-status-activity.html index f49c08c7..60332a81 100644 --- a/osinaweb/osinacore/templates/details_templates/partials/new-status-activity.html +++ b/osinaweb/osinacore/templates/details_templates/partials/new-status-activity.html @@ -178,7 +178,7 @@

{{status.text}}

{% if status.type and status.type_id %} - +
{% if status.type == 'Task' %}

{{status.task.project}}

diff --git a/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html b/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html index 8142a321..5b83bbd2 100644 --- a/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html +++ b/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html @@ -169,7 +169,7 @@

{{status.text}}

{% if status.type and status.type_id %} -
+
{% if status.type == 'Task' %}

{{status.task.project}}