change method function to GetOrCreateTeamsByOIDCAndNames
This commit is contained in:
parent
a2d5f06cde
commit
af1e71f256
|
@ -215,7 +215,7 @@ func HandleCallback(c echo.Context) error {
|
||||||
// find or create Teams and assign user as teammember.
|
// find or create Teams and assign user as teammember.
|
||||||
if len(teamData) > 0 {
|
if len(teamData) > 0 {
|
||||||
log.Debugf("TeamData is set %v", teamData)
|
log.Debugf("TeamData is set %v", teamData)
|
||||||
teams, err := GetOrCreateTeamsByNames(s, teamData, u)
|
teams, err := GetOrCreateTeamsByOIDCAndNames(s, teamData, u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Error verifying team for name %v, got %v", cl.Name, teams, err)
|
log.Errorf("Error verifying team for name %v, got %v", cl.Name, teams, err)
|
||||||
return err
|
return err
|
||||||
|
@ -297,7 +297,7 @@ func CreateTeamWithData(s *xorm.Session, teamData TeamData, u *user.User) (team
|
||||||
}
|
}
|
||||||
|
|
||||||
// this functions creates an array of existing teams that was generated from the oidc data.
|
// this functions creates an array of existing teams that was generated from the oidc data.
|
||||||
func GetOrCreateTeamsByNames(s *xorm.Session, teamData []TeamData, u *user.User) (te []models.Team, err error) {
|
func GetOrCreateTeamsByOIDCAndNames(s *xorm.Session, teamData []TeamData, u *user.User) (te []models.Team, err error) {
|
||||||
te = []models.Team{}
|
te = []models.Team{}
|
||||||
// Procedure can only be successful if oidcID is set and converted to string
|
// Procedure can only be successful if oidcID is set and converted to string
|
||||||
for _, oidcTeam := range teamData {
|
for _, oidcTeam := range teamData {
|
||||||
|
|
Loading…
Reference in New Issue