mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-19 16:30:15 +00:00
Allow Organisations to have a E-Mail (#25082)
Resolves #25057 This adds a E-Mail field to Organisations. The E-Mail is just shown on the Profile when it is visited by a logged in User. The E-mail is not used for something else. **Screenshots:**   --------- Co-authored-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: Denys Konovalov <privat@denyskon.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
af1ffbcd63
commit
6598d0291c
11 changed files with 48 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue