Skip to content

Commit 0365eec

Browse files
committed
Fix no project filter list issue
1 parent be48c8b commit 0365eec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

models/issues/issue_search.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ func applyMilestoneCondition(sess *xorm.Session, opts *IssuesOptions) {
198198

199199
func applyProjectCondition(sess *xorm.Session, opts *IssuesOptions) {
200200
opts.ProjectIDs = util.RemoveValue(opts.ProjectIDs, 0)
201-
if len(opts.ProjectIDs) > 0 { // specific project
201+
if len(opts.ProjectIDs) == 1 && opts.ProjectIDs[0] == db.NoConditionID { // show those that are in no project
202+
sess.And(builder.NotIn("issue.id", builder.Select("issue_id").From("project_issue")))
203+
} else if len(opts.ProjectIDs) > 0 { // specific project
202204
sess.Join("INNER", "project_issue", "issue.id = project_issue.issue_id").
203205
In("project_issue.project_id", opts.ProjectIDs)
204206
}

0 commit comments

Comments
 (0)