diff --git a/pkg/models/teams.go b/pkg/models/teams.go index 9c4c5034f..e6037fb11 100644 --- a/pkg/models/teams.go +++ b/pkg/models/teams.go @@ -216,7 +216,7 @@ func addMoreInfoToTeams(s *xorm.Session, teams []*Team) (err error) { // If def_adm is true, the user will be an admin of the team // Note: this function has been extracted from the Create method to allow // an additional parameter to control whether the user should become admin of the team -func (t *Team) CreateNewTeam(s *xorm.Session, a web.Auth, adm bool) (err error) { +func (t *Team) CreateNewTeam(s *xorm.Session, a web.Auth, firstUserShouldBeAdmin bool) (err error) { doer, err := user.GetFromAuth(a) if err != nil { @@ -236,7 +236,7 @@ func (t *Team) CreateNewTeam(s *xorm.Session, a web.Auth, adm bool) (err error) return } - tm := TeamMember{TeamID: t.ID, Username: doer.Username, Admin: adm} + tm := TeamMember{TeamID: t.ID, Username: doer.Username, Admin: firstUserShouldBeAdmin} if err = tm.Create(s, doer); err != nil { return err }