Skip to content

Commit 7fc73a9

Browse files
fix bug where all repos are returned even when opts.GroupID == 0
1 parent 0509b91 commit 7fc73a9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

models/repo/repo_list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ func SearchRepositoryCondition(opts SearchRepoOptions) builder.Cond {
474474
}
475475
if opts.GroupID > 0 {
476476
cond = cond.And(builder.Eq{"`repository`.group_id": opts.GroupID})
477+
} else if opts.GroupID == -1 {
478+
cond = cond.And(builder.Lt{"`repository`.group_id": 1})
477479
}
478480

479481
if opts.Keyword != "" {

0 commit comments

Comments
 (0)