fix: template

This commit is contained in:
root
2025-07-12 23:39:57 +08:00
parent 10c802a96b
commit 8047701388
4 changed files with 14 additions and 7 deletions

View File

@@ -159,8 +159,12 @@ PostgreSQL 驱动 psycopg2 未安装。请安装:
now = datetime.now()
# 处理 draft_content,如果 template_info 有 draft_content 属性则使用,否则为空对象
draft_content = getattr(template_info, 'draft_content', {})
# 处理 draft_content
draft_content = template_info.draft_content
if draft_content is None:
draft_content = {}
logger.debug(f"Storing draft_content for template {template_id}: {type(draft_content)} with {len(draft_content)} keys")
cursor.execute(insert_sql, (
template_id,