fix(tasks): don't include undone overdue tasks from archived lists or namespaces in notification mails
continuous-integration/drone/push Build is failing Details

Resolves vikunja/api#1324
This commit is contained in:
kolaente 2022-12-01 18:07:30 +01:00
parent fbc4b91e0f
commit 47aae115df
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 4 additions and 1 deletions

View File

@ -337,6 +337,7 @@
bucket_id: 20
created: 2018-12-01 01:12:04
updated: 2018-12-01 01:12:04
due_date: 2018-10-30 22:25:24
- id: 37
title: 'task #37'
done: false

View File

@ -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 {