fix(tasks): don't check for namespaces in filters

This commit is contained in:
kolaente 2022-12-29 18:32:56 +01:00
parent 68baafa990
commit fd9b2e15d9
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 7 deletions

View File

@ -329,7 +329,7 @@ func getRawTasksForProjects(s *xorm.Session, projects []*Project, a web.Auth, op
reminderFilters := []builder.Cond{}
assigneeFilters := []builder.Cond{}
labelFilters := []builder.Cond{}
namespaceFilters := []builder.Cond{}
projectFilters := []builder.Cond{}
var filters = make([]builder.Cond, 0, len(opts.filters))
// To still find tasks with nil values, we exclude 0s when comparing with >/< values.
@ -367,13 +367,13 @@ func getRawTasksForProjects(s *xorm.Session, projects []*Project, a web.Auth, op
continue
}
if f.field == "namespace" || f.field == "namespace_id" {
f.field = "namespace_id"
if f.field == "parent_project" || f.field == "parent_project_id" {
f.field = "parent_project_id"
filter, err := getFilterCond(f, opts.filterIncludeNulls)
if err != nil {
return nil, 0, 0, err
}
namespaceFilters = append(namespaceFilters, filter)
projectFilters = append(projectFilters, filter)
continue
}
@ -452,13 +452,13 @@ func getRawTasksForProjects(s *xorm.Session, projects []*Project, a web.Auth, op
filters = append(filters, getFilterCondForSeparateTable("label_tasks", opts.filterConcat, labelFilters))
}
if len(namespaceFilters) > 0 {
if len(projectFilters) > 0 {
var filtercond builder.Cond
if opts.filterConcat == filterConcatOr {
filtercond = builder.Or(namespaceFilters...)
filtercond = builder.Or(projectFilters...)
}
if opts.filterConcat == filterConcatAnd {
filtercond = builder.And(namespaceFilters...)
filtercond = builder.And(projectFilters...)
}
cond := builder.In(