Internal
Public Access
Fix recurring task duplication bug
Prevent process_recurring_tasks from creating duplicate tasks for dates that already have completed instances. Previously only checked for pending tasks, causing old completed recurring tasks to reappear as pending when subsequent instances went overdue. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.5
parent
cdcae378b7
commit
c8ffa615f0
@@ -161,12 +161,12 @@ def process_recurring_tasks():
|
|||||||
next_due_date = task.calculate_next_due_date()
|
next_due_date = task.calculate_next_due_date()
|
||||||
if next_due_date:
|
if next_due_date:
|
||||||
# Check if we already created this recurrence
|
# Check if we already created this recurrence
|
||||||
|
# Check for any task (pending OR completed) to avoid duplicates
|
||||||
existing = Task.objects.filter(
|
existing = Task.objects.filter(
|
||||||
user=task.user,
|
user=task.user,
|
||||||
title=task.title,
|
title=task.title,
|
||||||
due_date=next_due_date,
|
due_date=next_due_date,
|
||||||
recurrence=task.recurrence,
|
recurrence=task.recurrence
|
||||||
status='pending'
|
|
||||||
).exists()
|
).exists()
|
||||||
|
|
||||||
if not existing:
|
if not existing:
|
||||||
|
|||||||
Reference in New Issue
Block a user