fix(views): do not return kanban tasks multiple times

This commit is contained in:
kolaente 2024-03-16 15:30:19 +01:00
parent 27cb6e3372
commit 004f1e06bb
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 4 additions and 2 deletions

View File

@ -261,7 +261,9 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo
limit, start := getLimitFromPageIndex(opts.page, opts.perPage)
cond := builder.And(builder.Or(projectIDCond, favoritesCond), where, filterCond)
query := d.s.Where(cond)
query := d.s.
Distinct("tasks.*").
Where(cond)
if limit > 0 {
query = query.Limit(limit, start)
}

View File

@ -922,7 +922,7 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) {
}
buckets := make(map[int64]*Bucket)
err = s.In("project_project_id",
err = s.In("project_view_id",
builder.Select("id").
From("project_views").
Where(builder.Eq{"project_id": t.ProjectID}),