Serviceaccounts: Do not display service accounts assigned to team (#48995)

* Add IsServiceAccount to query

* test for excluding service accounts in query

* align test

* test update

* added logging

* should fix tests

* moved test to bottom

* add back setup function

* Remove IsServiceAccount from query

Instead use false for is_service_account
and when the time comes to implement service accounts
for team. we deal with it

* missed teamtest

* formatting
This commit is contained in:
Eric Leijonmarck
2022-05-24 16:52:39 +10:00
committed by GitHub
parent 69e2ab3d0f
commit cbf71fbd7f
2 changed files with 40 additions and 2 deletions
+3
View File
@@ -535,6 +535,9 @@ func (ss *SQLStore) getTeamMembers(ctx context.Context, query *models.GetTeamMem
fmt.Sprintf("team_member.user_id=%s.%s", ss.Dialect.Quote("user"), ss.Dialect.Quote("id")),
)
// explicitly check for serviceaccounts
sess.Where(fmt.Sprintf("%s.is_service_account=?", ss.Dialect.Quote("user")), ss.Dialect.BooleanStr(false))
if acUserFilter != nil {
sess.Where(acUserFilter.Where, acUserFilter.Args...)
}