From e3e08dcc5184cdbdac5023fabaafba123a995c3e 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. --- 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 a3082e9ac..ba0fd756e 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) }