Skip to content

Commit

Permalink
Respect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (
Browse files Browse the repository at this point in the history
…go-gitea#30013)

This PR adds `setting.Service.DefaultOrgMemberVisible` value to dataset
of user when the initial org creator is being added to the created org.

Fixes go-gitea#30012.
  • Loading branch information
DrMaxNix authored and silverwind committed Mar 24, 2024
1 parent 7ceb7e3 commit 6bd4a0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions models/organization/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ func CreateOrganization(ctx context.Context, org *Organization, owner *user_mode

// Add initial creator to organization and owner team.
if err = db.Insert(ctx, &OrgUser{
UID: owner.ID,
OrgID: org.ID,
UID: owner.ID,
OrgID: org.ID,
IsPublic: setting.Service.DefaultOrgMemberVisible,
}); err != nil {
return fmt.Errorf("insert org-user relation: %w", err)
}
Expand Down

0 comments on commit 6bd4a0c

Please sign in to comment.