Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ai_inventory/ai_accounts_forecast/models/account_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def create_financial_forecast(
# Validate forecast type
valid_types = ["Cash Flow", "Revenue", "Expense", "Balance Sheet", "P&L"]
if forecast_type not in valid_types:
raise ValueError(f"Forecast Type cannot be \"{forecast_type}\". It should be one of {', '.join(f'\"{t}\"' for t in valid_types)}")
raise ValueError(
f'Forecast Type cannot be "{forecast_type}". '
f"It should be one of {', '.join(map(repr, valid_types))}"
)

try:
# Get account details
Expand Down