This commit is contained in:
m.huber 2025-07-21 22:26:40 +02:00
parent 349c594489
commit 2e141d820a
2 changed files with 8 additions and 6 deletions

View File

@ -856,10 +856,13 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
Config: config, Config: config,
}) })
deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeExternalWiki) deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeExternalWiki)
} else if !*opts.HasWiki && !unit_model.TypeExternalWiki.UnitGlobalDisabled() { } else if !*opts.HasWiki {
deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeExternalWiki) if !unit_model.TypeExternalWiki.UnitGlobalDisabled() {
} else if !*opts.HasWiki && !unit_model.TypeWiki.UnitGlobalDisabled() { deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeExternalWiki)
deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeWiki) }
if !unit_model.TypeWiki.UnitGlobalDisabled() {
deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeWiki)
}
} }
} }

View File

@ -53,9 +53,8 @@ func getRepoEditOptionFromRepo(repo *repo_model.Repository) *api.EditRepoOption
hasWiki = true hasWiki = true
} else if unit, err := repo.GetUnit(db.DefaultContext, unit_model.TypeExternalWiki); err == nil { } else if unit, err := repo.GetUnit(db.DefaultContext, unit_model.TypeExternalWiki); err == nil {
hasWiki = true hasWiki = true
config := unit.ExternalWikiConfig()
externalWiki = &api.ExternalWiki{ externalWiki = &api.ExternalWiki{
ExternalWikiURL: config.ExternalWikiURL, ExternalWikiURL: unit.ExternalWikiConfig().ExternalWikiURL,
} }
} }
defaultBranch := repo.DefaultBranch defaultBranch := repo.DefaultBranch