Fixed ui and template mapping issue
This commit is contained in:
18
update_templates.py
Normal file
18
update_templates.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.join(os.getcwd(), 'docengine'))
|
||||
|
||||
from app.core.database import SessionLocal
|
||||
from app.models.template import DocumentFormat
|
||||
|
||||
db = SessionLocal()
|
||||
# Deactivate all templates starting with 'Template_' that have a UUID-like suffix (or just all where description starts with 'Auto-generated')
|
||||
templates = db.query(DocumentFormat).filter(
|
||||
DocumentFormat.description.startswith("Auto-generated")
|
||||
).all()
|
||||
|
||||
for t in templates:
|
||||
t.is_active = False
|
||||
|
||||
db.commit()
|
||||
print(f"Deactivated {len(templates)} auto-generated templates.")
|
||||
Reference in New Issue
Block a user