|
|
@ -216,6 +216,7 @@ func SettingsPost(ctx *context.Context) { |
|
|
|
ctx.Redirect(repo.Link() + "/settings") |
|
|
|
ctx.Redirect(repo.Link() + "/settings") |
|
|
|
|
|
|
|
|
|
|
|
case "advanced": |
|
|
|
case "advanced": |
|
|
|
|
|
|
|
var repoChanged bool |
|
|
|
var units []models.RepoUnit |
|
|
|
var units []models.RepoUnit |
|
|
|
var deleteUnitTypes []models.UnitType |
|
|
|
var deleteUnitTypes []models.UnitType |
|
|
|
|
|
|
|
|
|
|
@ -223,6 +224,11 @@ func SettingsPost(ctx *context.Context) { |
|
|
|
// as an error on the UI for this action
|
|
|
|
// as an error on the UI for this action
|
|
|
|
ctx.Data["Err_RepoName"] = nil |
|
|
|
ctx.Data["Err_RepoName"] = nil |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if repo.CloseIssuesViaCommitInAnyBranch != form.EnableCloseIssuesViaCommitInAnyBranch { |
|
|
|
|
|
|
|
repo.CloseIssuesViaCommitInAnyBranch = form.EnableCloseIssuesViaCommitInAnyBranch |
|
|
|
|
|
|
|
repoChanged = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if form.EnableWiki && form.EnableExternalWiki && !models.UnitTypeExternalWiki.UnitGlobalDisabled() { |
|
|
|
if form.EnableWiki && form.EnableExternalWiki && !models.UnitTypeExternalWiki.UnitGlobalDisabled() { |
|
|
|
if !validation.IsValidExternalURL(form.ExternalWikiURL) { |
|
|
|
if !validation.IsValidExternalURL(form.ExternalWikiURL) { |
|
|
|
ctx.Flash.Error(ctx.Tr("repo.settings.external_wiki_url_error")) |
|
|
|
ctx.Flash.Error(ctx.Tr("repo.settings.external_wiki_url_error")) |
|
|
@ -326,6 +332,12 @@ func SettingsPost(ctx *context.Context) { |
|
|
|
ctx.ServerError("UpdateRepositoryUnits", err) |
|
|
|
ctx.ServerError("UpdateRepositoryUnits", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if repoChanged { |
|
|
|
|
|
|
|
if err := models.UpdateRepository(repo, false); err != nil { |
|
|
|
|
|
|
|
ctx.ServerError("UpdateRepository", err) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
log.Trace("Repository advanced settings updated: %s/%s", ctx.Repo.Owner.Name, repo.Name) |
|
|
|
log.Trace("Repository advanced settings updated: %s/%s", ctx.Repo.Owner.Name, repo.Name) |
|
|
|
|
|
|
|
|
|
|
|
ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success")) |
|
|
|
ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success")) |
|
|
@ -361,10 +373,6 @@ func SettingsPost(ctx *context.Context) { |
|
|
|
repo.IsFsckEnabled = form.EnableHealthCheck |
|
|
|
repo.IsFsckEnabled = form.EnableHealthCheck |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if repo.CloseIssuesViaCommitInAnyBranch != form.EnableCloseIssuesViaCommitInAnyBranch { |
|
|
|
|
|
|
|
repo.CloseIssuesViaCommitInAnyBranch = form.EnableCloseIssuesViaCommitInAnyBranch |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err := models.UpdateRepository(repo, false); err != nil { |
|
|
|
if err := models.UpdateRepository(repo, false); err != nil { |
|
|
|
ctx.ServerError("UpdateRepository", err) |
|
|
|
ctx.ServerError("UpdateRepository", err) |
|
|
|
return |
|
|
|
return |
|
|
|