Production Release: RestDays Widget + Trainingstyp Fix #16

Merged
Lars merged 10 commits from develop into main 2026-03-23 09:24:17 +01:00
Showing only changes of commit ef27660fc8 - Show all commits

View File

@ -50,10 +50,14 @@ async def upload_photo(file: UploadFile=File(...), date: str="",
ext = Path(file.filename).suffix or '.jpg'
path = PHOTOS_DIR / f"{fid}{ext}"
async with aiofiles.open(path,'wb') as f: await f.write(await file.read())
# Convert empty string to NULL for date field
photo_date = date if date and date.strip() else None
with get_db() as conn:
cur = get_cursor(conn)
cur.execute("INSERT INTO photos (id,profile_id,date,path,created) VALUES (%s,%s,%s,%s,CURRENT_TIMESTAMP)",
(fid,pid,date,str(path)))
(fid,pid,photo_date,str(path)))
# Phase 2: Increment usage counter
increment_feature_usage(pid, 'photos')