mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-16 23:12:43 +00:00
[GITEA] repo: Don't redirect the repo to external units
When displaying the repo home view, do not redirect to unit types that can't be defaults (which, at the moment, are the external wiki and issue tracker unit types). If we'd redirect to those, that would mean that a repository with the Code unit disabled, and an external issue tracker would immediately redirect to the external issue tracker, making it harder to reach other, non-external units of the repo. Fixes #1965. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu> (cherry picked from commit44078e5460
) (cherry picked from commit1868dec2e4
) (cherry picked from commitc3a8e98870
) (cherry picked from commit9266b1916f
) (cherry picked from commit8fa5ff65af
)
This commit is contained in:
parent
abfc169fc8
commit
92f41d11dd
2 changed files with 104 additions and 1 deletions
|
@ -747,7 +747,7 @@ func checkHomeCodeViewable(ctx *context.Context) {
|
|||
}
|
||||
|
||||
unit, ok := unit_model.Units[repoUnit.Type]
|
||||
if ok && (firstUnit == nil || !firstUnit.IsLessThan(unit)) {
|
||||
if ok && (firstUnit == nil || !firstUnit.IsLessThan(unit)) && repoUnit.Type.CanBeDefault() {
|
||||
firstUnit = &unit
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue