diff --git a/routers/repo/attachment_model.go b/routers/repo/attachment_model.go index e89666174..15da4f54f 100644 --- a/routers/repo/attachment_model.go +++ b/routers/repo/attachment_model.go @@ -144,13 +144,11 @@ func GetModelChunks(ctx *context.Context) { if dbmodeluuid != modeluuid { log.Info("The file has uploaded.fileChunk.ObjectName=" + fileChunk.ObjectName + " typeCloudBrain=" + fmt.Sprint(typeCloudBrain)) isExist := copyModelAttachmentFile(typeCloudBrain, fileChunk, fileName, modeluuid) - if dbmodeluuid != "" { - model, err := models.QueryModelById(dbmodeluuid) + if isExist { + model, err := models.QueryModelById(modeluuid) if err == nil && model != nil { modelname = model.Name } - } - if isExist { ctx.JSON(200, map[string]string{ "uuid": fileChunk.UUID, "uploaded": strconv.Itoa(fileChunk.IsUploaded),