fix(tasks): don't include undone overdue tasks from archived lists or namespaces in notification mails
Resolves https://kolaente.dev/vikunja/api/issues/1324
This commit is contained in:
@ -37,7 +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 < ?", nextMinute.Add(time.Hour*14).Format(dbTimeFormat)).
|
||||
Where("due_date is not null AND due_date < ? AND lists.is_archived = ? AND namespaces.is_archived = ?", nextMinute.Add(time.Hour*14).Format(dbTimeFormat), false, false).
|
||||
Join("INNER", "lists", "lists.id = tasks.list_id").
|
||||
Join("INNER", "namespaces", "lists.namespace_id = lists.id").
|
||||
And("done = false").
|
||||
Find(&tasks)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user