mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-05-02 02:36:26 +00:00
fix: connected_squads stores UUIDs, not int IDs — use get_server_ids_by_uuids
connected_squads JSON contains squad UUIDs like 'b4d782fa-...', not integer IDs. int() cast fails on these. Now resolves UUIDs to integer IDs via get_server_ids_by_uuids() before passing to remove_user_from_servers.
This commit is contained in:
@@ -1192,10 +1192,13 @@ class UserService:
|
||||
squad_ids = user.subscription.connected_squads
|
||||
if squad_ids:
|
||||
try:
|
||||
from app.database.crud.server_squad import remove_user_from_servers
|
||||
from app.database.crud.server_squad import (
|
||||
get_server_ids_by_uuids,
|
||||
remove_user_from_servers,
|
||||
)
|
||||
|
||||
# JSON may store IDs as strings — cast to int
|
||||
int_squad_ids = [int(sid) for sid in squad_ids if sid]
|
||||
# connected_squads stores UUIDs — resolve to integer IDs
|
||||
int_squad_ids = await get_server_ids_by_uuids(db, list(squad_ids))
|
||||
if int_squad_ids:
|
||||
# Own savepoint so failure doesn't abort subscription deletion
|
||||
async with db.begin_nested():
|
||||
|
||||
Reference in New Issue
Block a user