aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/org/org.go12
-rw-r--r--routers/web/org/setting.go1
2 files changed, 12 insertions, 1 deletions
diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go
index 4e30ad1762..b0666c87f8 100644
--- a/routers/api/v1/org/org.go
+++ b/routers/api/v1/org/org.go
@@ -255,6 +255,7 @@ func Create(ctx *context.APIContext) {
org := &organization.Organization{
Name: form.UserName,
FullName: form.FullName,
+ Email: form.Email,
Description: form.Description,
Website: form.Website,
Location: form.Location,
@@ -299,7 +300,15 @@ func Get(ctx *context.APIContext) {
ctx.NotFound("HasOrgOrUserVisible", nil)
return
}
- ctx.JSON(http.StatusOK, convert.ToOrganization(ctx, ctx.Org.Organization))
+
+ org := convert.ToOrganization(ctx, ctx.Org.Organization)
+
+ // Don't show Mail, when User is not logged in
+ if ctx.Doer == nil {
+ org.Email = ""
+ }
+
+ ctx.JSON(http.StatusOK, org)
}
// Edit change an organization's information
@@ -328,6 +337,7 @@ func Edit(ctx *context.APIContext) {
form := web.GetForm(ctx).(*api.EditOrgOption)
org := ctx.Org.Organization
org.FullName = form.FullName
+ org.Email = form.Email
org.Description = form.Description
org.Website = form.Website
org.Location = form.Location
diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go
index bd558f78b8..f63b2e9f06 100644
--- a/routers/web/org/setting.go
+++ b/routers/web/org/setting.go
@@ -100,6 +100,7 @@ func SettingsPost(ctx *context.Context) {
}
org.FullName = form.FullName
+ org.Email = form.Email
org.Description = form.Description
org.Website = form.Website
org.Location = form.Location