diff --git a/models/issues/pull.go b/models/issues/pull.go index 9f180f9ac950b..b83caa0521650 100644 --- a/models/issues/pull.go +++ b/models/issues/pull.go @@ -141,7 +141,7 @@ type PullRequest struct { HeadCommitID string `xorm:"-"` BaseBranch string MergeBase string `xorm:"VARCHAR(64)"` - AllowMaintainerEdit bool `xorm:"NOT NULL DEFAULT false"` + AllowMaintainerEdit bool `xorm:"NOT NULL DEFAULT true"` HasMerged bool `xorm:"INDEX"` MergedCommitID string `xorm:"VARCHAR(64)"` diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index bb6bda587db6c..93c09cd8bd4dc 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -905,7 +905,7 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error { AllowRebaseUpdate: true, DefaultDeleteBranchAfterMerge: false, DefaultMergeStyle: repo_model.MergeStyleMerge, - DefaultAllowMaintainerEdit: false, + DefaultAllowMaintainerEdit: true, } } else { config = unit.PullRequestsConfig() diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index e034731e5cd54..f325ec07255e7 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -718,7 +718,7 @@ func CompareDiff(ctx *context.Context) { config := unit.PullRequestsConfig() ctx.Data["AllowMaintainerEdit"] = config.DefaultAllowMaintainerEdit } else { - ctx.Data["AllowMaintainerEdit"] = false + ctx.Data["AllowMaintainerEdit"] = true } ctx.HTML(http.StatusOK, tplCompare) diff --git a/services/convert/repository.go b/services/convert/repository.go index 150c952b15dc3..61fbe75511088 100644 --- a/services/convert/repository.go +++ b/services/convert/repository.go @@ -102,7 +102,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR autodetectManualMerge := false defaultDeleteBranchAfterMerge := false defaultMergeStyle := repo_model.MergeStyleMerge - defaultAllowMaintainerEdit := false + defaultAllowMaintainerEdit := true defaultTargetBranch := "" if unit, err := repo.GetUnit(ctx, unit_model.TypePullRequests); err == nil { config := unit.PullRequestsConfig()