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

@ -240,7 +240,11 @@ async def _handle_callback_query(cb: dict) -> None:
return
if action == "approve":
await db.update_registration_status(reg_id, "approved")
updated = await db.update_registration_status(reg_id, "approved")
if not updated:
# Already processed (not pending) — ack the callback and stop
await telegram.answer_callback_query(callback_query_id)
return
if chat_id and message_id:
await telegram.edit_message_text(
chat_id, message_id, f"✅ Пользователь {reg['login']} одобрен"
@ -254,7 +258,10 @@ async def _handle_callback_query(cb: dict) -> None:
)
)
elif action == "reject":
await db.update_registration_status(reg_id, "rejected")
updated = await db.update_registration_status(reg_id, "rejected")
if not updated:
await telegram.answer_callback_query(callback_query_id)
return
if chat_id and message_id:
await telegram.edit_message_text(
chat_id, message_id, f"❌ Пользователь {reg['login']} отклонён"