fix: handle datetime.date object for birth_year in ZIP export
PostgreSQL returns dob as datetime.date object, not string. Changed from prof['dob'][:4] to prof['dob'].year Error was: TypeError: 'datetime.date' object is not subscriptable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
64d1b9bf7b
commit
b6f8b11685
|
|
@ -1599,7 +1599,7 @@ Datumsformat: YYYY-MM-DD
|
|||
"email": prof.get('email'),
|
||||
"sex": prof.get('sex'),
|
||||
"height": float(prof['height']) if prof.get('height') else None,
|
||||
"birth_year": int(prof['dob'][:4]) if prof.get('dob') else None,
|
||||
"birth_year": prof['dob'].year if prof.get('dob') else None,
|
||||
"goal_weight": float(prof['goal_weight']) if prof.get('goal_weight') else None,
|
||||
"goal_bf_pct": float(prof['goal_bf_pct']) if prof.get('goal_bf_pct') else None,
|
||||
"avatar_color": prof.get('avatar_color'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user