Commit
·
e0805f7
1
Parent(s):
91647c6
Fix syntax errors: indentation issues
Browse files
app/smart_recommendation.py
CHANGED
|
@@ -44,7 +44,7 @@ class SmartBudgetRecommender:
|
|
| 44 |
# This ensures we only show recommendations for budgets the user actually created
|
| 45 |
if not category_data:
|
| 46 |
print(f"No budgets found for user_id: {user_id}, returning empty recommendations")
|
| 47 |
-
|
| 48 |
|
| 49 |
recommendations: List[BudgetRecommendation] = []
|
| 50 |
|
|
@@ -84,7 +84,7 @@ class SmartBudgetRecommender:
|
|
| 84 |
elif std_dev > avg_expense * 0.05:
|
| 85 |
recommended_budget = avg_expense * 1.20
|
| 86 |
action = "increase"
|
| 87 |
-
|
| 88 |
recommended_budget = avg_expense * 1.05
|
| 89 |
action = "increase"
|
| 90 |
|
|
@@ -731,7 +731,7 @@ class SmartBudgetRecommender:
|
|
| 731 |
|
| 732 |
if isinstance(date, str):
|
| 733 |
try:
|
| 734 |
-
|
| 735 |
except (ValueError, AttributeError):
|
| 736 |
continue
|
| 737 |
elif not isinstance(date, datetime):
|
|
|
|
| 44 |
# This ensures we only show recommendations for budgets the user actually created
|
| 45 |
if not category_data:
|
| 46 |
print(f"No budgets found for user_id: {user_id}, returning empty recommendations")
|
| 47 |
+
return []
|
| 48 |
|
| 49 |
recommendations: List[BudgetRecommendation] = []
|
| 50 |
|
|
|
|
| 84 |
elif std_dev > avg_expense * 0.05:
|
| 85 |
recommended_budget = avg_expense * 1.20
|
| 86 |
action = "increase"
|
| 87 |
+
else:
|
| 88 |
recommended_budget = avg_expense * 1.05
|
| 89 |
action = "increase"
|
| 90 |
|
|
|
|
| 731 |
|
| 732 |
if isinstance(date, str):
|
| 733 |
try:
|
| 734 |
+
date = datetime.fromisoformat(date.replace('Z', '+00:00'))
|
| 735 |
except (ValueError, AttributeError):
|
| 736 |
continue
|
| 737 |
elif not isinstance(date, datetime):
|