0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-24 20:52:52 +01:00

Add more check

This commit is contained in:
Lunny Xiao 2024-10-30 17:48:16 -07:00
parent d74263430f
commit ec8fbde2c7
No known key found for this signature in database
GPG key ID: C3B7C91B632F738A

View file

@ -224,6 +224,11 @@ func UpdateTeam(ctx context.Context, t *organization.Team, updateCols ...string)
return util.NewInvalidArgumentErrorf("empty team name") 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") authChanged := slices.Contains(updateCols, "authorize")
includeAllChanged := slices.Contains(updateCols, "includes_all_repositories") includeAllChanged := slices.Contains(updateCols, "includes_all_repositories")