Skip to content

Commit e321b8a

Browse files
GiteaBotDrMaxNix
andauthored
Respect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (#30013) (#30035)
Backport #30013 by @DrMaxNix 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. Co-authored-by: DrMaxNix <[email protected]>
1 parent 2172b38 commit e321b8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

models/organization/org.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,9 @@ func CreateOrganization(org *Organization, owner *user_model.User) (err error) {
319319

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

0 commit comments

Comments
 (0)