Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-25 11:16:11 +01:00

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)
This commit is contained in:
DrMaxNix 2024-03-23 22:59:58 +01:00 committed by Earl Warren
parent 0dc6919e2d
commit a9a2f5200b
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -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)
}