From b1759520d8297c22dc3f273219183aa4a913850e Mon Sep 17 00:00:00 2001 From: Sam Splunks <72095718+samsplunks@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:52:23 +0000 Subject: [PATCH] Merge exclusion conditions for time_spent calculation --- helpdesk/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helpdesk/models.py b/helpdesk/models.py index d7bd9521..71ab2631 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -1047,10 +1047,10 @@ class FollowUp(models.Model): start_day_time = middle_day_time.replace(hour=0, minute=0, second=0) end_day_time = middle_day_time.replace(hour=23, minute=59, second=59) - if start_day_time.strftime("%m-%d") not in holidays: - if (self.ticket.status not in exclude_statuses and - self.ticket.queue.slug not in exclude_queues): - time_spent_seconds += daily_time_spent_calculation(start_day_time, end_day_time, open_hours) + if (start_day_time.strftime("%m-%d") not in holidays and + self.ticket.status not in exclude_statuses and + self.ticket.queue.slug not in exclude_queues): + time_spent_seconds += daily_time_spent_calculation(start_day_time, end_day_time, open_hours) return datetime.timedelta(seconds=time_spent_seconds)