fix: 模板重复导入问题
This commit is contained in:
parent
6b18e51f26
commit
9f6b6630ce
|
|
@ -192,8 +192,16 @@ class TemplateManager:
|
|||
with open(draft_file, 'r', encoding='utf-8') as f:
|
||||
draft_content = json.load(f)
|
||||
|
||||
# Generate template ID
|
||||
template_id = str(uuid.uuid4())
|
||||
# Use the original template ID from draft_content.json
|
||||
template_id = draft_content.get('id')
|
||||
if not template_id:
|
||||
logger.warning(f"No 'id' field found in draft_content.json for {template_path}")
|
||||
return None
|
||||
|
||||
# Check if template already exists
|
||||
if template_id in self.templates_metadata:
|
||||
logger.info(f"Template {template_id} already exists, skipping import")
|
||||
return None
|
||||
|
||||
# Create template directory
|
||||
template_dir = self.templates_dir / template_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue