Spaces:
Running
Running
axeronis commited on
Commit ·
d087150
1
Parent(s): b69431c
fix(playbook): use qualification_fields instead of outdated custom_fields
Browse files
backend/app/api/playbook.py
CHANGED
|
@@ -522,11 +522,12 @@ async def get_custom_fields(
|
|
| 522 |
detail="Tenant not found"
|
| 523 |
)
|
| 524 |
|
| 525 |
-
# Extract
|
| 526 |
-
default_fields = ["Бюджет", "Срочность"
|
| 527 |
|
| 528 |
if tenant.ai_settings and isinstance(tenant.ai_settings, dict):
|
| 529 |
-
|
|
|
|
| 530 |
else:
|
| 531 |
custom_fields = default_fields
|
| 532 |
|
|
@@ -587,7 +588,8 @@ async def generate_funnel_with_ai(
|
|
| 587 |
ai_settings = tenant.ai_settings or {}
|
| 588 |
business_description = ai_settings.get("business_description", "")
|
| 589 |
selling_style = ai_settings.get("selling_style", "Consultative")
|
| 590 |
-
|
|
|
|
| 591 |
|
| 592 |
# Get knowledge base
|
| 593 |
kb_result = await session.execute(
|
|
|
|
| 522 |
detail="Tenant not found"
|
| 523 |
)
|
| 524 |
|
| 525 |
+
# Extract qualification_fields from ai_settings (was: custom_fields - outdated)
|
| 526 |
+
default_fields = ["Имя", "Контакт", "Бюджет", "Срочность"]
|
| 527 |
|
| 528 |
if tenant.ai_settings and isinstance(tenant.ai_settings, dict):
|
| 529 |
+
# Use qualification_fields (current) with fallback to custom_fields (legacy)
|
| 530 |
+
custom_fields = tenant.ai_settings.get("qualification_fields") or tenant.ai_settings.get("custom_fields", default_fields)
|
| 531 |
else:
|
| 532 |
custom_fields = default_fields
|
| 533 |
|
|
|
|
| 588 |
ai_settings = tenant.ai_settings or {}
|
| 589 |
business_description = ai_settings.get("business_description", "")
|
| 590 |
selling_style = ai_settings.get("selling_style", "Consultative")
|
| 591 |
+
# Use qualification_fields (current) with fallback to custom_fields (legacy)
|
| 592 |
+
custom_fields = ai_settings.get("qualification_fields") or ai_settings.get("custom_fields", ["Имя", "Контакт", "Бюджет", "Срочность"])
|
| 593 |
|
| 594 |
# Get knowledge base
|
| 595 |
kb_result = await session.execute(
|