From 1b85bb6e4919518beaf27b6f2bf4ba03dd8406b3 Mon Sep 17 00:00:00 2001 From: Dan Clark Date: Fri, 9 Feb 2024 18:26:20 +0000 Subject: [PATCH] Stop DrManhattan catching overlapping but identically named tasks --- volunteers/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/volunteers/models.py b/volunteers/models.py index 3e8eaa1..eb6363a 100644 --- a/volunteers/models.py +++ b/volunteers/models.py @@ -538,8 +538,9 @@ def detect_dr_manhattan(self): schedule[date] = [] for task in current_tasks: for item in schedule[task.date]: - if item.start_time <= task.start_time < item.end_time \ - or item.start_time < task.end_time <= item.end_time: + if (item.start_time <= task.start_time < item.end_time \ + or item.start_time < task.end_time <= item.end_time) \ + and (item.name != task.name and item.location != task.location): retval[0] = True item_found = False for task_set in retval[1]: