mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-19 19:18:43 +02:00
improvements
This commit is contained in:
parent
59e91b9585
commit
22cdf7e191
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user