diff options
author | DrMaxNix <mail@drmaxnix.de> | 2024-03-23 22:59:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-23 21:59:58 +0000 |
commit | e3e08dcc5184cdbdac5023fabaafba123a995c3e (patch) | |
tree | d8e10f8346add257101e3138a5495fd8baf012a5 /models/organization | |
parent | 900dd79d8adaf2569df0f1346b6e6e91ed4b5ad3 (diff) | |
download | gitea-e3e08dcc5184cdbdac5023fabaafba123a995c3e.tar.gz gitea-e3e08dcc5184cdbdac5023fabaafba123a995c3e.zip |
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.
Diffstat (limited to 'models/organization')
-rw-r--r-- | models/organization/org.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/models/organization/org.go b/models/organization/org.go index a3082e9ac7..ba0fd756e3 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) } |