kin: BATON-008-backend_dev
This commit is contained in:
parent
36087c3d9e
commit
fde7f57a7a
5 changed files with 48 additions and 20 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue