Fixed ui and template mapping issue

This commit is contained in:
2026-07-14 12:43:09 +05:30
parent fb0a78a405
commit 460a1c5c51
11 changed files with 383 additions and 39 deletions

18
update_templates.py Normal file
View 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.")