]> source.dussan.org Git - gitea.git/commitdiff
Respect DEFAULT_ORG_MEMBER_VISIBLE setting when adding creator to org (#30013) (...
authorGiteabot <teabot@gitea.io>
Sun, 24 Mar 2024 05:38:31 +0000 (13:38 +0800)
committerGitHub <noreply@github.com>
Sun, 24 Mar 2024 05:38:31 +0000 (06:38 +0100)
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>
models/organization/org.go

index 260571b4b242a0c71e650d9764d4379998f8c011..dad6c7f37dd05312d805615377dd9194646eb456 100644 (file)
@@ -319,8 +319,9 @@ func CreateOrganization(org *Organization, owner *user_model.User) (err error) {
 
        // 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)
        }