0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-19 19:18:43 +02:00

improvements

This commit is contained in:
Lunny Xiao 2025-07-05 22:11:32 -07:00
parent 59e91b9585
commit 22cdf7e191
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
3 changed files with 3 additions and 10 deletions

View File

@ -955,8 +955,8 @@ func UpdateUserCols(ctx context.Context, u *User, cols ...string) error {
return err
}
// UpdateUserColsWithNoAutotime update user according special columns
func UpdateUserColsWithNoAutotime(ctx context.Context, u *User, cols ...string) error {
// UpdateUserColsNoAutotime update user according special columns
func UpdateUserColsNoAutotime(ctx context.Context, u *User, cols ...string) error {
if err := ValidateUser(u, cols...); err != nil {
return err
}

View File

@ -60,10 +60,3 @@ func ExtractKeysFromMapString(in map[string]VisibleType) (keys []string) {
}
return keys
}
func ConvertStringToVisibleType(s string) VisibleType {
if vt, ok := VisibilityModes[s]; ok {
return vt
}
return VisibleType(-1) // Invalid type
}

View File

@ -155,7 +155,7 @@ func ChangeOrganizationVisibility(ctx context.Context, org *org_model.Organizati
org.Visibility = visibility
// FIXME: If it's a big forks network(forks and sub forks), the database transaction will be too long to fail.
return db.WithTx(ctx, func(ctx context.Context) error {
if err := user_model.UpdateUserColsWithNoAutotime(ctx, org.AsUser(), "visibility"); err != nil {
if err := user_model.UpdateUserColsNoAutotime(ctx, org.AsUser(), "visibility"); err != nil {
return err
}