From 3f4dc1a528b01b5459d88bf0cba5015843c72d42 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 24 Jul 2018 10:14:12 +0800 Subject: [PATCH] fix: testing --- models/repo_list.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/repo_list.go b/models/repo_list.go index 644aceabe..1d7020aa8 100644 --- a/models/repo_list.go +++ b/models/repo_list.go @@ -184,7 +184,7 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (RepositoryList, int64, err if opts.Collaborate != util.OptionalBoolFalse { collaborateCond := builder.And( - builder.Expr("id IN (SELECT repo_id FROM `access` WHERE access.user_id = ?)", opts.OwnerID), + builder.Expr("repository.id IN (SELECT repo_id FROM `access` WHERE access.user_id = ?)", opts.OwnerID), builder.Neq{"owner_id": opts.OwnerID}) if !opts.Private { collaborateCond = collaborateCond.And(builder.Expr("owner_id NOT IN (SELECT org_id FROM org_user WHERE org_user.uid = ? AND org_user.is_public = ?)", opts.OwnerID, false)) @@ -235,6 +235,7 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (RepositoryList, int64, err count, err := sess. Where(cond). Count(new(Repository)) + if err != nil { return nil, 0, fmt.Errorf("Count: %v", err) }