1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-16 00:05:47 +00:00

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 <mail@drmaxnix.de>
This commit is contained in:
Giteabot 2024-03-24 13:38:31 +08:00 committed by GitHub
parent 2172b38d50
commit e321b8a849
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -319,8 +319,9 @@ func CreateOrganization(org *Organization, owner *user_model.User) (err error) {
// Add initial creator to organization and owner team. // Add initial creator to organization and owner team.
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)
} }