diff options
author | Richard Mahn <richmahn@users.noreply.github.com> | 2019-05-30 13:57:55 -0400 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-05-30 13:57:55 -0400 |
commit | 43cf2f3b55de4a69183966da2a6e0167592c733c (patch) | |
tree | bdc943cdb6aabe6b48f5f3222ebb6587ae8cd70e /routers/api/v1/admin/org.go | |
parent | d95caf50ec9e34a652a0e51baf5037c8cf424a01 (diff) | |
download | gitea-43cf2f3b55de4a69183966da2a6e0167592c733c.tar.gz gitea-43cf2f3b55de4a69183966da2a6e0167592c733c.zip |
Fixes #7023 - API Org Visibility (#7028)
Diffstat (limited to 'routers/api/v1/admin/org.go')
-rw-r--r-- | routers/api/v1/admin/org.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/api/v1/admin/org.go b/routers/api/v1/admin/org.go index fba41a8cfe..d740647cd4 100644 --- a/routers/api/v1/admin/org.go +++ b/routers/api/v1/admin/org.go @@ -45,6 +45,11 @@ func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) { return } + visibility := api.VisibleTypePublic + if form.Visibility != "" { + visibility = api.VisibilityModes[form.Visibility] + } + org := &models.User{ Name: form.UserName, FullName: form.FullName, @@ -53,7 +58,9 @@ func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) { Location: form.Location, IsActive: true, Type: models.UserTypeOrganization, + Visibility: visibility, } + if err := models.CreateOrganization(org, u); err != nil { if models.IsErrUserAlreadyExist(err) || models.IsErrNameReserved(err) || |