Skip to content

Commit 34a6f4c

Browse files
committed
Fix test
1 parent 90274a4 commit 34a6f4c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

models/org.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,7 @@ type FindOrgOptions struct {
529529
func queryUserOrgIDs(userID int64) *builder.Builder {
530530
return builder.Select("org_id").From("org_user").
531531
Where(builder.Eq{
532-
"uid": userID,
533-
"is_public": true,
532+
"uid": userID,
534533
})
535534
}
536535

@@ -559,7 +558,7 @@ func FindOrgs(opts FindOrgOptions) ([]*Organization, error) {
559558

560559
// CountOrgs returns total count organizations according options
561560
func CountOrgs(opts FindOrgOptions) (int64, error) {
562-
return db.GetEngine(db.DefaultContext).Join("INNER", "`org_user`", "`org_user`.org_id=`user`.id").
561+
return db.GetEngine(db.DefaultContext).
563562
Where(opts.toConds()).
564563
Count(new(User))
565564
}

models/org_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ func TestFindOrgs(t *testing.T) {
324324
IncludePrivate: false,
325325
})
326326
assert.NoError(t, err)
327-
assert.EqualValues(t, 0, len(orgs))
327+
assert.EqualValues(t, 1, len(orgs))
328328

329329
total, err := CountOrgs(FindOrgOptions{
330330
UserID: 4,

0 commit comments

Comments
 (0)