1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-23 00:54:28 +00: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.
This commit is contained in:
DrMaxNix 2024-03-23 22:59:58 +01:00 committed by GitHub
parent 900dd79d8a
commit e3e08dcc51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -321,6 +321,7 @@ func CreateOrganization(ctx context.Context, org *Organization, owner *user_mode
if err = db.Insert(ctx, &OrgUser{ if err = db.Insert(ctx, &OrgUser{
UID: owner.ID, UID: owner.ID,
OrgID: org.ID, OrgID: org.ID,
IsPublic: setting.Service.DefaultOrgMemberVisible,
}); err != nil { }); err != nil {
return fmt.Errorf("insert org-user relation: %w", err) return fmt.Errorf("insert org-user relation: %w", err)
} }