kin: BATON-008-backend_dev

This commit is contained in:
Gros Frumos 2026-03-21 09:34:21 +02:00
parent 36087c3d9e
commit fde7f57a7a
5 changed files with 48 additions and 20 deletions

View file

@ -341,9 +341,10 @@ async def get_registration(reg_id: int) -> Optional[dict]:
async def update_registration_status(reg_id: int, status: str) -> bool:
"""Update registration status only if currently 'pending'. Returns False if already processed."""
async with _get_conn() as conn:
async with conn.execute(
"UPDATE registrations SET status = ? WHERE id = ?",
"UPDATE registrations SET status = ? WHERE id = ? AND status = 'pending'",
(status, reg_id),
) as cur:
changed = cur.rowcount > 0