This commit is contained in:
william-allspice 2024-08-16 15:41:25 -05:00
parent c6d4e19ca5
commit a91cc98e7f
2 changed files with 1 additions and 3 deletions

View File

@ -15,7 +15,6 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
"github.com/stretchr/testify/assert"
)
@ -90,12 +89,10 @@ func TestIsUserOfficialReviewer(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
log.Info(fmt.Sprintf("repo.IsPrivate %v", repo.IsPrivate))
protectedBranch := &git_model.ProtectedBranch{
RepoID: repo.ID,
EnableApprovalsWhitelist: false,
}
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 3})
access := &access_model.Access{

View File

@ -277,6 +277,7 @@ func IsOfficialReviewer(ctx context.Context, issue *Issue, reviewer *user_model.
}
return writeAccess, nil
}
official, err := git_model.IsUserOfficialReviewer(ctx, rule, reviewer)
if official || err != nil {
return official, err