Skip to content

Commit 7678260

Browse files
committed
Fix test
1 parent f9c9dd0 commit 7678260

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

models/org.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,10 @@ type FindOrgOptions struct {
528528

529529
func queryUserOrgIDs(userID int64) *builder.Builder {
530530
return builder.Select("org_id").From("org_user").
531-
Where(builder.Eq{"uid": userID})
531+
Where(builder.Eq{
532+
"uid": userID,
533+
"is_public": true,
534+
})
532535
}
533536

534537
func (opts FindOrgOptions) toConds() builder.Cond {
@@ -538,10 +541,6 @@ func (opts FindOrgOptions) toConds() builder.Cond {
538541
}
539542
if !opts.IncludePrivate {
540543
cond = cond.And(builder.Eq{"`user`.visibility": structs.VisibleTypePublic})
541-
} else {
542-
cond = cond.And(builder.Eq{"`user`.visibility": structs.VisibleTypePrivate}.Or(
543-
builder.Eq{"`user`.visibility": structs.VisibleTypeLimited},
544-
))
545544
}
546545
return cond
547546
}

0 commit comments

Comments
 (0)