change error note and append team pointer in GetOrCreateTeamsByOIDCAndNames

This commit is contained in:
viehlieb 2023-05-09 13:36:23 +02:00
parent 193ef53df8
commit 1b390fbc95

View File

@ -273,7 +273,7 @@ func AssignOrCreateUserToTeams(s *xorm.Session, u *user.User, teamData []models.
if !exists {
err = tm.Create(s, u)
if err != nil {
log.Errorf("Could not assign %v to %v. %v", u.Username, team.Name, err)
log.Errorf("Could not assign user %s to team %s: %v", u.Username, team.Name, err)
}
}
oidcTeams = append(oidcTeams, team.ID)
@ -370,7 +370,7 @@ func GetOrCreateTeamsByOIDCAndNames(s *xorm.Session, teamData []models.OIDCTeamD
te = append(te, newTeam)
} else {
log.Debugf("Team with oidc_id %v and name %v already exists.", team.OidcID, team.Name)
te = append(te, &team)
te = append(te, team)
}
}
return te, err