emile 4 months ago
parent 4f6f5ac3e6
commit 49d461d4ac

@ -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):

@ -178,7 +178,7 @@
<p class="text-sm {% if 'Completed' in status.text %} text-green-700 {% else %} text-secondosiblue {% endif %}">{{status.text}}</p>
{% if status.type and status.type_id %}
<a {% if status.type == 'Task' and status.type_id %} href="{% url 'detailed-project' status.task.project.project_id %}" {% elif status.type == 'Daily Report' %} href="{% url 'dailyreports' %}" {% endif %}>
<a {% if status.type == 'Task' and status.type_id %} href="{% url 'detailed-project' status.project %}" {% elif status.type == 'Daily Report' %} href="{% url 'dailyreports' %}" {% endif %}>
<div class="w-full flex justify-end items-center mt-1 text-gray-400 hover:text-secondosiblue duration-300 cursor-pointer">
{% if status.type == 'Task' %}
<p class="text-xs font-light">{{status.task.project}}</p>

@ -169,7 +169,7 @@
<p class="text-sm {% if 'Completed' in status.text %} text-green-700 {% else %} text-secondosiblue {% endif %}">{{status.text}}</p>
{% if status.type and status.type_id %}
<a {% if status.type == 'Task' and status.type_id %} href="{% url 'detailed-project' status.task.project.project_id %}" {% elif status.type == 'Daily Report' %} href="{% url 'dailyreports' %}" {% endif %}>
<a {% if status.type == 'Task' and status.type_id %} href="{% url 'detailed-project' status.project %}" {% elif status.type == 'Daily Report' %} href="{% url 'dailyreports' %}" {% endif %}>
<div class="w-full flex justify-end items-center mt-1 text-gray-400 hover:text-secondosiblue duration-300 cursor-pointer">
{% if status.type == 'Task' %}
<p class="text-xs font-light">{{status.task.project}}</p>

Loading…
Cancel
Save