|
|
|
@@ -146,7 +146,8 @@ func SaveModel(ctx *context.Context) { |
|
|
|
|
|
|
|
if !trainTaskCreate { |
|
|
|
if !ctx.Repo.CanWrite(models.UnitTypeModelManage) { |
|
|
|
ctx.ServerError("No right.", errors.New(ctx.Tr("repo.model_noright"))) |
|
|
|
ctx.NotFound(ctx.Req.URL.RequestURI(), nil) |
|
|
|
//ctx.ServerError("No right.", errors.New(ctx.Tr("repo.model_noright"))) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -270,7 +271,7 @@ func DownloadMultiModelFile(ctx *context.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
if !isOper(ctx, task.UserId) { |
|
|
|
ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) |
|
|
|
ctx.NotFound(ctx.Req.URL.RequestURI(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
@@ -552,7 +553,7 @@ func isOper(ctx *context.Context, modelUserId int64) bool { |
|
|
|
func ShowModelPageInfo(ctx *context.Context) { |
|
|
|
log.Info("ShowModelInfo start.") |
|
|
|
if !isQueryRight(ctx) { |
|
|
|
ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) |
|
|
|
ctx.NotFound(ctx.Req.URL.RequestURI(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
page := ctx.QueryInt("page") |
|
|
|
@@ -624,7 +625,8 @@ func ModifyModelInfo(ctx *context.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
if !isOper(ctx, task.UserId) { |
|
|
|
ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) |
|
|
|
ctx.NotFound(ctx.Req.URL.RequestURI(), nil) |
|
|
|
//ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|