Fixed bug where team with admin privelege type doesn't get any unit attached to the team (#4719) (#4759)
This commit is contained in:
parent
066515429f
commit
e9def84bf2
1 changed files with 3 additions and 2 deletions
|
@ -181,7 +181,8 @@ func NewTeamPost(ctx *context.Context, form auth.CreateTeamForm) {
|
||||||
Description: form.Description,
|
Description: form.Description,
|
||||||
Authorize: models.ParseAccessMode(form.Permission),
|
Authorize: models.ParseAccessMode(form.Permission),
|
||||||
}
|
}
|
||||||
if t.Authorize < models.AccessModeAdmin {
|
|
||||||
|
if t.Authorize < models.AccessModeOwner {
|
||||||
var units = make([]*models.TeamUnit, 0, len(form.Units))
|
var units = make([]*models.TeamUnit, 0, len(form.Units))
|
||||||
for _, tp := range form.Units {
|
for _, tp := range form.Units {
|
||||||
units = append(units, &models.TeamUnit{
|
units = append(units, &models.TeamUnit{
|
||||||
|
@ -270,7 +271,7 @@ func EditTeamPost(ctx *context.Context, form auth.CreateTeamForm) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t.Description = form.Description
|
t.Description = form.Description
|
||||||
if t.Authorize < models.AccessModeAdmin {
|
if t.Authorize < models.AccessModeOwner {
|
||||||
var units = make([]models.TeamUnit, 0, len(form.Units))
|
var units = make([]models.TeamUnit, 0, len(form.Units))
|
||||||
for _, tp := range form.Units {
|
for _, tp := range form.Units {
|
||||||
units = append(units, models.TeamUnit{
|
units = append(units, models.TeamUnit{
|
||||||
|
|
Reference in a new issue