Skip to content

Commit

Permalink
Merge branch 'main' into fix-20621-no-err-in-IsUserAllowedToUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
lafriks committed Aug 18, 2022
2 parents 1803e6a + 999392f commit c0192bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion routers/api/v1/org/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func EditTeam(ctx *context.APIContext) {
}

if form.CanCreateOrgRepo != nil {
team.CanCreateOrgRepo = *form.CanCreateOrgRepo
team.CanCreateOrgRepo = team.IsOwnerTeam() || *form.CanCreateOrgRepo
}

if len(form.Name) > 0 {
Expand Down
5 changes: 4 additions & 1 deletion routers/web/org/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,11 @@ func EditTeamPost(ctx *context.Context) {
isIncludeAllChanged = true
t.IncludesAllRepositories = includesAllRepositories
}
t.CanCreateOrgRepo = form.CanCreateOrgRepo
} else {
t.CanCreateOrgRepo = true
}

t.Description = form.Description
if t.AccessMode < perm.AccessModeAdmin {
units := make([]organization.TeamUnit, 0, len(unitPerms))
Expand All @@ -433,7 +437,6 @@ func EditTeamPost(ctx *context.Context) {
return
}
}
t.CanCreateOrgRepo = form.CanCreateOrgRepo

if ctx.HasError() {
ctx.HTML(http.StatusOK, tplTeamNew)
Expand Down

0 comments on commit c0192bb

Please sign in to comment.