MCPcopy Create free account
hub / github.com/gogs/gogs / SettingsAvatarPost

Function SettingsAvatarPost

internal/route/user/setting.go:173–181  ·  view source on GitHub ↗
(c *context.Context, f form.Avatar)

Source from the content-addressed store, hash-verified

171}
172
173func SettingsAvatarPost(c *context.Context, f form.Avatar) {
174 if err := UpdateAvatarSetting(c, f, c.User); err != nil {
175 c.Flash.Error(err.Error())
176 } else {
177 c.Flash.Success(c.Tr("settings.update_avatar_success"))
178 }
179
180 c.RedirectSubpath("/user/settings/avatar")
181}
182
183func SettingsDeleteAvatar(c *context.Context) {
184 err := database.Handle.Users().DeleteCustomAvatar(c.Req.Context(), c.User.ID)

Callers

nothing calls this directly

Calls 5

SuccessMethod · 0.80
TrMethod · 0.80
RedirectSubpathMethod · 0.80
UpdateAvatarSettingFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected