mitai-jinkendo/backend/routers
Lars 4d9c59ccf7
All checks were successful
Deploy Development / deploy (push) Successful in 34s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 12s
fix: [BUG-001] TypeError in nutrition_weekly endpoint
Problem:
- /api/nutrition/weekly crashed with 500 Internal Server Error
- TypeError: strptime() argument 1 must be str, not datetime.date

Root Cause:
- d['date'] from PostgreSQL is already datetime.date object
- datetime.strptime() expects string input
- Line 156: wk=datetime.strptime(d['date'],'%Y-%m-%d').strftime('%Y-W%V')

Solution:
- Added type check before strptime()
- If date already has strftime method → use directly
- Else → parse as string first
- Works with both datetime.date objects and strings

Tested:
- /nutrition page loads without error
- Weekly aggregation works correctly
- Chart displays nutrition data

Closes: BUG-001

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 07:58:37 +01:00
..
__init__.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
access_grants.py feat: add admin management routers for subscription system 2026-03-19 13:09:33 +01:00
activity.py feat: complete Phase 4 enforcement for all features (backend) 2026-03-21 07:40:37 +01:00
admin.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
auth.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
caliper.py feat: Phase 4 Batch 1 - enable enforcement for data entries 2026-03-21 06:57:05 +01:00
circumference.py feat: Phase 4 Batch 1 - enable enforcement for data entries 2026-03-21 06:57:05 +01:00
coupons.py feat: add coupon management and redemption 2026-03-19 13:07:09 +01:00
exportdata.py feat: complete Phase 4 enforcement for all features (backend) 2026-03-21 07:40:37 +01:00
features.py fix: prevent connection pool exhaustion in features/usage 2026-03-21 07:02:42 +01:00
importdata.py feat: complete Phase 4 enforcement for all features (backend) 2026-03-21 07:40:37 +01:00
insights.py feat: complete Phase 4 enforcement for all features (backend) 2026-03-21 07:40:37 +01:00
nutrition.py fix: [BUG-001] TypeError in nutrition_weekly endpoint 2026-03-21 07:58:37 +01:00
photos.py feat: complete Phase 4 enforcement for all features (backend) 2026-03-21 07:40:37 +01:00
profiles.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
prompts.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
stats.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
subscription.py feat: add user subscription info endpoints 2026-03-19 13:05:55 +01:00
tier_limits.py fix: show all tiers in admin matrix editor including selfhosted 2026-03-20 06:19:32 +01:00
tiers_mgmt.py feat: add admin management routers for subscription system 2026-03-19 13:09:33 +01:00
user_restrictions.py feat: add admin management routers for subscription system 2026-03-19 13:09:33 +01:00
weight.py feat: Phase 4 Batch 1 - enable enforcement for data entries 2026-03-21 06:57:05 +01:00