diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-05-20 08:56:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 00:56:45 +0000 |
commit | edbf74c418061b013a5855f604dd6be6baf34132 (patch) | |
tree | 0c8fa83ec5f2eec37669d6eb75274a79de8f7e78 /services/repository | |
parent | 82a0c36332824b8ab41efdf6503e86170ce92f08 (diff) | |
download | gitea-edbf74c418061b013a5855f604dd6be6baf34132.tar.gz gitea-edbf74c418061b013a5855f604dd6be6baf34132.zip |
Fix "force private" logic (#31012)
When creating a repo, the "FORCE_PRIVATE" config option should be
respected, `readonly` doesn't work for checkbox, so it should use
`disabled` attribute.
Diffstat (limited to 'services/repository')
-rw-r--r-- | services/repository/repository.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/repository/repository.go b/services/repository/repository.go index d28200c0ad..b7aac3cfe0 100644 --- a/services/repository/repository.go +++ b/services/repository/repository.go @@ -85,7 +85,7 @@ func PushCreateRepo(ctx context.Context, authUser, owner *user_model.User, repoN repo, err := CreateRepository(ctx, authUser, owner, CreateRepoOptions{ Name: repoName, - IsPrivate: setting.Repository.DefaultPushCreatePrivate, + IsPrivate: setting.Repository.DefaultPushCreatePrivate || setting.Repository.ForcePrivate, }) if err != nil { return nil, err |