Browse Source

Fix errors in create org UI regarding team access permission. (#8506)

for-closed-social
David Svantesson 5 years ago
committed by zeripath
parent
commit
366806db32
3 changed files with 10 additions and 8 deletions
  1. +3
    -2
      modules/auth/org.go
  2. +5
    -4
      routers/org/org.go
  3. +2
    -2
      templates/org/create.tmpl

+ 3
- 2
modules/auth/org.go View File

@ -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

+ 5
- 4
routers/org/org.go View File

@ -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 {

+ 2
- 2
templates/org/create.tmpl View File

@ -33,9 +33,9 @@
</div>
</div>
<div class="field" id="permission_box">
<div class="inline field" id="permission_box">
<label>{{.i18n.Tr "org.settings.permission"}}</label>
<div class="field">
<div class="inline-grouped-list">
<div class="ui checkbox">
<input class="hidden" type="checkbox" name="repo_admin_change_team_access" checked/>
<label>{{.i18n.Tr "org.settings.repoadminchangeteam"}}</label>

Loading…
Cancel
Save