Skip to content

Commit c0192bb

Browse files
authored
Merge branch 'main' into fix-20621-no-err-in-IsUserAllowedToUpdate
2 parents 1803e6a + 999392f commit c0192bb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

routers/api/v1/org/team.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func EditTeam(ctx *context.APIContext) {
262262
}
263263

264264
if form.CanCreateOrgRepo != nil {
265-
team.CanCreateOrgRepo = *form.CanCreateOrgRepo
265+
team.CanCreateOrgRepo = team.IsOwnerTeam() || *form.CanCreateOrgRepo
266266
}
267267

268268
if len(form.Name) > 0 {

routers/web/org/teams.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,11 @@ func EditTeamPost(ctx *context.Context) {
416416
isIncludeAllChanged = true
417417
t.IncludesAllRepositories = includesAllRepositories
418418
}
419+
t.CanCreateOrgRepo = form.CanCreateOrgRepo
420+
} else {
421+
t.CanCreateOrgRepo = true
419422
}
423+
420424
t.Description = form.Description
421425
if t.AccessMode < perm.AccessModeAdmin {
422426
units := make([]organization.TeamUnit, 0, len(unitPerms))
@@ -433,7 +437,6 @@ func EditTeamPost(ctx *context.Context) {
433437
return
434438
}
435439
}
436-
t.CanCreateOrgRepo = form.CanCreateOrgRepo
437440

438441
if ctx.HasError() {
439442
ctx.HTML(http.StatusOK, tplTeamNew)

0 commit comments

Comments
 (0)