aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/http.go')
-rw-r--r--routers/web/repo/http.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/web/repo/http.go b/routers/web/repo/http.go
index 162338a959..7c5dcd42be 100644
--- a/routers/web/repo/http.go
+++ b/routers/web/repo/http.go
@@ -22,6 +22,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/login"
+ "code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
@@ -99,11 +100,11 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
}
isWiki := false
- var unitType = models.UnitTypeCode
+ var unitType = unit.TypeCode
var wikiRepoName string
if strings.HasSuffix(reponame, ".wiki") {
isWiki = true
- unitType = models.UnitTypeWiki
+ unitType = unit.TypeWiki
wikiRepoName = reponame
reponame = reponame[:len(reponame)-5]
}
@@ -270,7 +271,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
if isWiki {
// Ensure the wiki is enabled before we allow access to it
- if _, err := repo.GetUnit(models.UnitTypeWiki); err != nil {
+ if _, err := repo.GetUnit(unit.TypeWiki); err != nil {
if models.IsErrUnitTypeNotExist(err) {
ctx.HandleText(http.StatusForbidden, "repository wiki is disabled")
return