1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-10-29 08:17:31 -04:00

Fixed bug where team with admin privelege type doesn't get any unit attached to the team (#4719)

This commit is contained in:
Lanre Adelowo 2018-08-21 18:02:32 +01:00 committed by techknowlogick
parent 05dcfcfc33
commit 6ca8fbd2f9

View File

@ -186,7 +186,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{
@ -275,7 +276,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{