From b10f00bf1fd46df722879aaa80d2227707603916 Mon Sep 17 00:00:00 2001 From: emile Date: Thu, 26 Dec 2024 17:13:08 +0200 Subject: [PATCH] dd --- .../__pycache__/models.cpython-310.pyc | Bin 17289 -> 17451 bytes osinaweb/osinacore/models.py | 10 ++++++++++ .../partials/recent-activities.html | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc index 73457085523f5bfd376be86a3418840fe3ba39f0..30ec5955c66cd2c951af469a06daee3de60affdc 100644 GIT binary patch delta 439 zcmYjNKP&@L7{BkFx;xjZ(_US%G?p#~6KU&Dum}<{X++cLr6Fmr-dz*vf{-9=-_G1f zBbd!55tF1WCYwZ>2vy~KOXCf{eBbZi%X>!$aDE6r+v`;YIx8%fZJWRJ-HpHrK96kc zmY(U#`1gf9NCq?AOF~q?PLCEvsNrL57Rnfj5BGgju&Pblma|~HGh6G9TNYU_k?aEB zjUMHU##<1C8Xm_7@g`;(?2D^)f~d@P_}n1C@py2~;M)&}CI_-IGd=#$8~9P7yJqt8E<1e#*(-=5yHsS NsxqvC-l=yO@*m$ZaN+;} delta 334 zcmZ48!Pwc($d}K{%f$c$D+_be?|N_KJ8Qw%F!_!}JzENYFoUMR=3L8CCdT5)kFC8J zH7D!Y7)k#GD!#?zlAl`amtW#qky%`#$y6i(6f9al`JO sj<*=!Y?g6qWE5Zlss!o=5+Hp=QIj9Aicdb`9LK4_#VEur#4g4G02o0~mjD0& diff --git a/osinaweb/osinacore/models.py b/osinaweb/osinacore/models.py index 4827cf84..8d55dc12 100644 --- a/osinaweb/osinacore/models.py +++ b/osinaweb/osinacore/models.py @@ -462,6 +462,16 @@ class Status(models.Model): return None return None + @property + def project_name(self): + if self.type == 'Task' and self.type_id: + try: + task = Task.objects.get(id=self.type_id) + return task.project.name + except Task.DoesNotExist: + return None + return None + @receiver(post_save, sender=Status) def new_ticket_update_handler(sender, instance, created, **kwargs): if created: diff --git a/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html b/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html index 5b83bbd2..2e962e1a 100644 --- a/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html +++ b/osinaweb/osinacore/templates/details_templates/partials/recent-activities.html @@ -172,7 +172,7 @@
{% if status.type == 'Task' %} -

{{status.task.project}}

+

{{status.project_name}}

{% elif status.type == 'Daily Report' %}

View Daily Report

{% endif %}