From 8f900e3d2f78fbfbd53b1598171ea3869926520b Mon Sep 17 00:00:00 2001 From: yaojin Date: Tue, 16 Jan 2024 04:16:03 +0800 Subject: [PATCH] template fix bug --- src/backend/bisheng/api/v1/skillcenter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/bisheng/api/v1/skillcenter.py b/src/backend/bisheng/api/v1/skillcenter.py index ffdec3955..9ffde4365 100644 --- a/src/backend/bisheng/api/v1/skillcenter.py +++ b/src/backend/bisheng/api/v1/skillcenter.py @@ -47,13 +47,13 @@ def read_template(*, """Read all flows.""" sql = select(Template.id, Template.name, Template.description, Template.update_time) if id: - sql = select(Template).where(Template.id == id) + template = session.get(Template, id) + return resp_200([template]) if name: sql.where(Template.name == name) sql.order_by(Template.order_num.desc()) if page_size and page_name: sql.offset(page_size * (page_name - 1)).limit(page_size) - try: template_session = session.exec(sql) templates = template_session.mappings().all()