|
|
|
@@ -476,7 +476,18 @@ func ModifyModelInfo(ctx *context.Context) { |
|
|
|
id := ctx.Query("ID") |
|
|
|
description := ctx.Query("Description") |
|
|
|
|
|
|
|
err := ModifyModel(id, description) |
|
|
|
task, err := models.QueryModelById(id) |
|
|
|
if err != nil { |
|
|
|
log.Error("no such model!", err.Error()) |
|
|
|
ctx.ServerError("no such model:", err) |
|
|
|
return |
|
|
|
} |
|
|
|
if !isCanDeleteOrDownload(ctx, task) { |
|
|
|
ctx.ServerError("no right.", errors.New(ctx.Tr("repo.model_noright"))) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
err = ModifyModel(id, description) |
|
|
|
|
|
|
|
if err == nil { |
|
|
|
ctx.HTML(200, "success") |
|
|
|
|