diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-10-17 07:29:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 07:29:26 +0800 |
commit | f860a6d2e4177ed4f4c2a58a07882bd00a1a52ad (patch) | |
tree | 93abb2f354576e50c87d70b0b4bb46369fb3a1f1 /services/user | |
parent | 5d3dbffa150d832d2f9aedd9f90ca91178a95f9c (diff) | |
download | gitea-f860a6d2e4177ed4f4c2a58a07882bd00a1a52ad.tar.gz gitea-f860a6d2e4177ed4f4c2a58a07882bd00a1a52ad.zip |
Add system setting table with cache and also add cache supports for user setting (#18058)
Diffstat (limited to 'services/user')
-rw-r--r-- | services/user/user.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/user/user.go b/services/user/user.go index 1edd9294cb..dab9ac61a4 100644 --- a/services/user/user.go +++ b/services/user/user.go @@ -13,12 +13,12 @@ import ( "time" "code.gitea.io/gitea/models" - admin_model "code.gitea.io/gitea/models/admin" asymkey_model "code.gitea.io/gitea/models/asymkey" "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/organization" packages_model "code.gitea.io/gitea/models/packages" repo_model "code.gitea.io/gitea/models/repo" + system_model "code.gitea.io/gitea/models/system" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/avatar" "code.gitea.io/gitea/modules/eventsource" @@ -186,7 +186,7 @@ func DeleteUser(ctx context.Context, u *user_model.User, purge bool) error { path := user_model.UserPath(u.Name) if err := util.RemoveAll(path); err != nil { err = fmt.Errorf("Failed to RemoveAll %s: %v", path, err) - _ = admin_model.CreateNotice(ctx, admin_model.NoticeTask, fmt.Sprintf("delete user '%s': %v", u.Name, err)) + _ = system_model.CreateNotice(ctx, system_model.NoticeTask, fmt.Sprintf("delete user '%s': %v", u.Name, err)) return err } @@ -194,7 +194,7 @@ func DeleteUser(ctx context.Context, u *user_model.User, purge bool) error { avatarPath := u.CustomAvatarRelativePath() if err := storage.Avatars.Delete(avatarPath); err != nil { err = fmt.Errorf("Failed to remove %s: %v", avatarPath, err) - _ = admin_model.CreateNotice(ctx, admin_model.NoticeTask, fmt.Sprintf("delete user '%s': %v", u.Name, err)) + _ = system_model.CreateNotice(ctx, system_model.NoticeTask, fmt.Sprintf("delete user '%s': %v", u.Name, err)) return err } } |