diff --git a/notifications/tasks.py b/notifications/tasks.py index 377bc73..c9a0232 100644 --- a/notifications/tasks.py +++ b/notifications/tasks.py @@ -161,12 +161,12 @@ def process_recurring_tasks(): next_due_date = task.calculate_next_due_date() if next_due_date: # Check if we already created this recurrence + # Check for any task (pending OR completed) to avoid duplicates existing = Task.objects.filter( user=task.user, title=task.title, due_date=next_due_date, - recurrence=task.recurrence, - status='pending' + recurrence=task.recurrence ).exists() if not existing: