Browse Source

导入新模型的提示信息修改。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.3.2^2
zouap 4 years ago
parent
commit
d1836f4228
2 changed files with 15 additions and 2 deletions
  1. +13
    -1
      models/dbsql/repo_foreigntable_for_es.sql
  2. +2
    -1
      routers/repo/ai_model_manage.go

+ 13
- 1
models/dbsql/repo_foreigntable_for_es.sql View File

@@ -1,3 +1,4 @@
DROP FOREIGN TABLE public.repository_es;
CREATE FOREIGN TABLE public.repository_es (
id bigint NOT NULL,
owner_id bigint,
@@ -30,7 +31,7 @@ CREATE FOREIGN TABLE public.repository_es (
size bigint DEFAULT 0 NOT NULL,
is_fsck_enabled boolean DEFAULT true NOT NULL,
close_issues_via_commit_in_any_branch boolean DEFAULT false NOT NULL,
topics json,
topics text,
avatar character varying(64),
created_unix bigint,
updated_unix bigint,
@@ -145,6 +146,7 @@ LANGUAGE plpgsql;

DROP TRIGGER IF EXISTS es_insert_repository on public.repository;


CREATE TRIGGER es_insert_repository
AFTER INSERT ON public.repository
FOR EACH ROW EXECUTE PROCEDURE insert_repository_data();
@@ -160,7 +162,17 @@ $def$
$def$
LANGUAGE plpgsql;


DROP TRIGGER IF EXISTS es_update_repository_description on public.repository;
DROP TRIGGER IF EXISTS es_update_repository_name on public.repository;
DROP TRIGGER IF EXISTS es_update_repository_ownername on public.repository;
DROP TRIGGER IF EXISTS es_update_repository_website on public.repository;
DROP TRIGGER IF EXISTS es_update_repository_topics on public.repository;
DROP TRIGGER IF EXISTS es_update_repository_updated_unix on public.repository;
DROP TRIGGER IF EXISTS es_update_repository_num_watches on public.repository;
DROP TRIGGER IF EXISTS es_update_repository_num_stars on public.repository;
DROP TRIGGER IF EXISTS es_update_repository_num_forks on public.repository;
DROP TRIGGER IF EXISTS es_delete_repository on public.repository;

CREATE TRIGGER es_update_repository_description
AFTER UPDATE OF "description" ON public.repository


+ 2
- 1
routers/repo/ai_model_manage.go View File

@@ -114,7 +114,8 @@ func SaveNewNameModel(ctx *context.Context) {

aimodels := models.QueryModelByName(name, ctx.Repo.Repository.ID)
if len(aimodels) > 0 {
ctx.ServerError("Name error.", errors.New(ctx.Tr("repo.model_noright")))
ctx.Error(500, ctx.Tr("repo.model_rename"))
return
}
SaveModel(ctx)



Loading…
Cancel
Save