From 999392f6a5cfa450148cbcb42a17d3f7dcfd1ec7 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 18 Aug 2022 16:58:21 +0800 Subject: Fix owners cannot create organization repos bug (#20841) * Fix owners cannot create organization repos bug * Fix api * Update routers/api/v1/org/team.go Co-authored-by: Gusted Co-authored-by: Gusted --- routers/web/org/teams.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'routers/web/org') diff --git a/routers/web/org/teams.go b/routers/web/org/teams.go index 284fb096f3..9ee66a1a3e 100644 --- a/routers/web/org/teams.go +++ b/routers/web/org/teams.go @@ -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)) @@ -433,7 +437,6 @@ func EditTeamPost(ctx *context.Context) { return } } - t.CanCreateOrgRepo = form.CanCreateOrgRepo if ctx.HasError() { ctx.HTML(http.StatusOK, tplTeamNew) -- cgit v1.2.3