Skip to content

Commit

Permalink
use enum instead of hardcoded value
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored Jan 5, 2020
1 parent b689efb commit 9df9382
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/repo_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func SearchRepository(opts *SearchRepoOptions) (RepositoryList, int64, error) {
}

if opts.AllPublic {
accessCond = accessCond.Or(builder.Eq{"is_private": false}).And(builder.In("owner_id", builder.Select("`user`.id").From("`user`").Where(builder.Lte{"`user`.visibility": 1})))
accessCond = accessCond.Or(builder.Eq{"is_private": false}).And(builder.In("owner_id", builder.Select("`user`.id").From("`user`").Where(builder.Lte{"`user`.visibility": structs.VisibleTypePrivate})))
}

cond = cond.And(accessCond)
Expand Down

0 comments on commit 9df9382

Please sign in to comment.