|
|
@@ -147,7 +147,7 @@ func SaveModel(ctx *context.Context) { |
|
|
|
if !trainTaskCreate { |
|
|
|
if !ctx.Repo.CanWrite(models.UnitTypeModelManage) { |
|
|
|
//ctx.NotFound(ctx.Req.URL.RequestURI(), nil) |
|
|
|
ctx.JSON(403, errors.New(ctx.Tr("repo.model_noright"))) |
|
|
|
ctx.JSON(403, ctx.Tr("repo.model_noright")) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
@@ -415,7 +415,7 @@ func ShowModelInfo(ctx *context.Context) { |
|
|
|
ctx.Data["ID"] = ctx.Query("ID") |
|
|
|
ctx.Data["name"] = ctx.Query("name") |
|
|
|
ctx.Data["isModelManage"] = true |
|
|
|
//ctx.Data["ModelManageAccess"] = ctx.Repo.CanWrite(models.UnitTypeModelManage) |
|
|
|
ctx.Data["ModelManageAccess"] = ctx.Repo.CanWrite(models.UnitTypeModelManage) |
|
|
|
|
|
|
|
ctx.HTML(200, tplModelInfo) |
|
|
|
} |
|
|
@@ -511,7 +511,7 @@ func ShowModelTemplate(ctx *context.Context) { |
|
|
|
ctx.Data["isModelManage"] = true |
|
|
|
repoId := ctx.Repo.Repository.ID |
|
|
|
SetModelCount(ctx) |
|
|
|
|
|
|
|
ctx.Data["ModelManageAccess"] = ctx.Repo.CanWrite(models.UnitTypeModelManage) |
|
|
|
_, trainCount, _ := models.QueryModelTrainJobList(repoId) |
|
|
|
log.Info("query train count=" + fmt.Sprint(trainCount)) |
|
|
|
ctx.Data["TRAIN_COUNT"] = trainCount |
|
|
|