mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Fix bug on avatar (#31008)
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@ -46,6 +46,7 @@ func UpdateAvatar(ctx *context.APIContext) {
|
||||
err = user_service.UploadAvatar(ctx, ctx.Org.Organization.AsUser(), content)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "UploadAvatar", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Status(http.StatusNoContent)
|
||||
@ -72,6 +73,7 @@ func DeleteAvatar(ctx *context.APIContext) {
|
||||
err := user_service.DeleteAvatar(ctx, ctx.Org.Organization.AsUser())
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "DeleteAvatar", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Status(http.StatusNoContent)
|
||||
|
@ -39,6 +39,7 @@ func UpdateAvatar(ctx *context.APIContext) {
|
||||
err = user_service.UploadAvatar(ctx, ctx.Doer, content)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "UploadAvatar", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Status(http.StatusNoContent)
|
||||
@ -57,6 +58,7 @@ func DeleteAvatar(ctx *context.APIContext) {
|
||||
err := user_service.DeleteAvatar(ctx, ctx.Doer)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "DeleteAvatar", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Status(http.StatusNoContent)
|
||||
|
Reference in New Issue
Block a user