Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/auth/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions routers/org/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions templates/org/create.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down