diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-22 23:21:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 23:21:55 +0800 |
commit | baed01f24753afb600a2984dcb9bcda0bb8502b6 (patch) | |
tree | 5621ef980b6b0067a21c86be7e4808d83c0538ab /routers/web/org/setting.go | |
parent | c2ab19888f92fbdec4276a16d224e8de80d1d1dd (diff) | |
download | gitea-baed01f24753afb600a2984dcb9bcda0bb8502b6.tar.gz gitea-baed01f24753afb600a2984dcb9bcda0bb8502b6.zip |
Remove unnecessary attributes of User struct (#17745)
* Remove unnecessary functions of User struct
* Move more database methods out of user struct
* Move more database methods out of user struct
* Fix template failure
* Fix bug
* Remove finished FIXME
* remove unnecessary code
Diffstat (limited to 'routers/web/org/setting.go')
-rw-r--r-- | routers/web/org/setting.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go index f05dbd8bc1..7a6f4fec60 100644 --- a/routers/web/org/setting.go +++ b/routers/web/org/setting.go @@ -18,9 +18,10 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/web" - userSetting "code.gitea.io/gitea/routers/web/user/setting" + user_setting "code.gitea.io/gitea/routers/web/user/setting" "code.gitea.io/gitea/services/forms" "code.gitea.io/gitea/services/org" + user_service "code.gitea.io/gitea/services/user" ) const ( @@ -136,7 +137,7 @@ func SettingsPost(ctx *context.Context) { func SettingsAvatar(ctx *context.Context) { form := web.GetForm(ctx).(*forms.AvatarForm) form.Source = forms.AvatarLocal - if err := userSetting.UpdateAvatarSetting(ctx, form, ctx.Org.Organization.AsUser()); err != nil { + if err := user_setting.UpdateAvatarSetting(ctx, form, ctx.Org.Organization.AsUser()); err != nil { ctx.Flash.Error(err.Error()) } else { ctx.Flash.Success(ctx.Tr("org.settings.update_avatar_success")) @@ -147,7 +148,7 @@ func SettingsAvatar(ctx *context.Context) { // SettingsDeleteAvatar response for delete avatar on settings page func SettingsDeleteAvatar(ctx *context.Context) { - if err := ctx.Org.Organization.AsUser().DeleteAvatar(); err != nil { + if err := user_service.DeleteAvatar(ctx.Org.Organization.AsUser()); err != nil { ctx.Flash.Error(err.Error()) } |