From 366806db3219ee75010d7f699cc34e6264ab2685 Mon Sep 17 00:00:00 2001 From: David Svantesson Date: Mon, 14 Oct 2019 20:20:42 +0200 Subject: [PATCH] Fix errors in create org UI regarding team access permission. (#8506) --- modules/auth/org.go | 5 +++-- routers/org/org.go | 9 +++++---- templates/org/create.tmpl | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/auth/org.go b/modules/auth/org.go index 2abffdf74e..94e659cb5b 100644 --- a/modules/auth/org.go +++ b/modules/auth/org.go @@ -22,8 +22,9 @@ import ( // CreateOrgForm form for creating organization type CreateOrgForm struct { - OrgName string `binding:"Required;AlphaDashDot;MaxSize(40)" locale:"org.org_name_holder"` - Visibility structs.VisibleType + OrgName string `binding:"Required;AlphaDashDot;MaxSize(40)" locale:"org.org_name_holder"` + Visibility structs.VisibleType + RepoAdminChangeTeamAccess bool } // Validate validates the fields diff --git a/routers/org/org.go b/routers/org/org.go index 3821b32216..85bc25217b 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -47,10 +47,11 @@ func CreatePost(ctx *context.Context, form auth.CreateOrgForm) { } org := &models.User{ - Name: form.OrgName, - IsActive: true, - Type: models.UserTypeOrganization, - Visibility: form.Visibility, + Name: form.OrgName, + IsActive: true, + Type: models.UserTypeOrganization, + Visibility: form.Visibility, + RepoAdminChangeTeamAccess: form.RepoAdminChangeTeamAccess, } if err := models.CreateOrganization(org, ctx.User); err != nil { diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl index 8ae0fc22af..82c8766a95 100644 --- a/templates/org/create.tmpl +++ b/templates/org/create.tmpl @@ -33,9 +33,9 @@ -
+
-
+