diff options
author | Unknwon <u@gogs.io> | 2016-03-06 13:20:37 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-06 13:20:37 -0500 |
commit | 922a6f13a3c1b66a0a3160ba7f5658c018f00931 (patch) | |
tree | 32882aa197724e0f75608c9bfd16a24650b7be22 /routers/org/setting.go | |
parent | c2ca103d30b0f47b5ad0fa544ab5a07263894ea3 (diff) | |
parent | 9c91e279338f4d8bf09e1f7f5904d34cd525b102 (diff) |
Merge pull request #2766 from moltam/feature/delete-org-avatar
Added: Ability to delete org avatar.
Diffstat (limited to 'routers/org/setting.go')
-rw-r--r-- | routers/org/setting.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/org/setting.go b/routers/org/setting.go index 0b1b512d..29ce34f5 100644 --- a/routers/org/setting.go +++ b/routers/org/setting.go @@ -96,6 +96,14 @@ func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) { ctx.Redirect(ctx.Org.OrgLink + "/settings") } +func SettingsDeleteAvatar(ctx *middleware.Context) { + if err := ctx.Org.Organization.DeleteAvatar(); err != nil { + ctx.Flash.Error(err.Error()) + } + + ctx.Redirect(ctx.Org.OrgLink + "/settings") +} + func SettingsDelete(ctx *middleware.Context) { ctx.Data["Title"] = ctx.Tr("org.settings") ctx.Data["PageIsSettingsDelete"] = true |