From e4f841cf6a033e7e70e9c3b047f08e793ed766f1 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 23 Dec 2022 18:55:57 +0100 Subject: [PATCH] fix(tasks): sql for overdue reminders --- pkg/models/task_overdue_reminder.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/models/task_overdue_reminder.go b/pkg/models/task_overdue_reminder.go index 8cefb9af2..288906f12 100644 --- a/pkg/models/task_overdue_reminder.go +++ b/pkg/models/task_overdue_reminder.go @@ -37,9 +37,9 @@ func getUndoneOverdueTasks(s *xorm.Session, now time.Time) (usersWithTasks map[i var tasks []*Task err = s. - Where("due_date is not null AND due_date < ? AND lists.is_archived = false AND namespaces.is_archived = false", nextMinute.Add(time.Hour*14).Format(dbTimeFormat)). - Join("LEFT", "lists", "lists.id = tasks.list_id"). - Join("LEFT", "namespaces", "lists.namespace_id = namespaces.id"). + Where("due_date is not null AND due_date < ? AND projects.is_archived = false AND namespaces.is_archived = false", nextMinute.Add(time.Hour*14).Format(dbTimeFormat)). + Join("LEFT", "projects", "projects.id = tasks.project_id"). + Join("LEFT", "namespaces", "projects.namespace_id = namespaces.id"). And("done = false"). Find(&tasks) if err != nil {