aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-03-24 13:38:31 +0800
committerGitHub <noreply@github.com>2024-03-24 06:38:31 +0100
commite321b8a849087d736a96275d5960f9b1446c95ba (patch)
tree7e2ba921af2d9dde798a7c713c6a0c3eb28f0c18
parent2172b38d505fa9586edf5da0d4aad7307dc92b7d (diff)
downloadgitea-e321b8a849087d736a96275d5960f9b1446c95ba.tar.gz
gitea-e321b8a849087d736a96275d5960f9b1446c95ba.zip
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>
-rw-r--r--models/organization/org.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/organization/org.go b/models/organization/org.go
index 260571b4b2..dad6c7f37d 100644
--- a/models/organization/org.go
+++ b/models/organization/org.go
@@ -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)
}