From ec8fbde2c75f4f97836b7ef2160c1763461c31ac Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 30 Oct 2024 17:48:16 -0700 Subject: [PATCH] Add more check --- models/org_team.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/models/org_team.go b/models/org_team.go index 443e78996d..ea03de71dd 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -224,6 +224,11 @@ func UpdateTeam(ctx context.Context, t *organization.Team, updateCols ...string) return util.NewInvalidArgumentErrorf("empty team name") } + if slices.Contains(updateCols, "name") && !slices.Contains(updateCols, "lower_name") { + t.LowerName = strings.ToLower(t.Name) + updateCols = append(updateCols, "lower_name") + } + authChanged := slices.Contains(updateCols, "authorize") includeAllChanged := slices.Contains(updateCols, "includes_all_repositories")