summaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/setting.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/routers/org/setting.go b/routers/org/setting.go
index c6d2db3d97..9e26afa7d4 100644
--- a/routers/org/setting.go
+++ b/routers/org/setting.go
@@ -12,6 +12,7 @@ import (
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/setting"
+ "github.com/gogits/gogs/routers/user"
)
const (
@@ -73,6 +74,17 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateOrgSettingForm) {
ctx.Redirect(org.HomeLink() + "/settings")
}
+func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) {
+ form.Enable = true
+ if err := user.UpdateAvatarSetting(ctx, form, ctx.Org.Organization); err != nil {
+ ctx.Flash.Error(err.Error())
+ } else {
+ ctx.Flash.Success(ctx.Tr("org.settings.update_avatar_success"))
+ }
+
+ ctx.Redirect(ctx.Org.OrgLink + "/settings")
+}
+
func SettingsDelete(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("org.settings")
ctx.Data["PageIsSettingsDelete"] = true