From a9a2f5200b6d6ac0626a45e0098b6b06bafffd03 Mon Sep 17 00:00:00 2001 From: DrMaxNix Date: Sat, 23 Mar 2024 22:59:58 +0100 Subject: [PATCH] Respect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (#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 #30012. (cherry picked from commit e3e08dcc5184cdbdac5023fabaafba123a995c3e) --- models/organization/org.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/organization/org.go b/models/organization/org.go index b4919defb..47230bdc3 100644 --- a/models/organization/org.go +++ b/models/organization/org.go @@ -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) }