fix key create for user in admin

This commit is contained in:
Vladless
2025-05-24 23:25:49 +03:00
parent 1309c3ef43
commit 9ae2de2eb5
2 changed files with 10 additions and 3 deletions
+9 -3
View File
@@ -1391,14 +1391,20 @@ async def handle_create_key_cluster(
callback_query: CallbackQuery, state: FSMContext, session
):
cluster_name = callback_query.data
tg_id = callback_query.from_user.id
await state.update_data(cluster_name=cluster_name, tg_id=tg_id)
data = await state.get_data()
tg_id = data.get("tg_id")
if not tg_id:
await callback_query.message.edit_text("❌ Ошибка: tg_id клиента не найден.")
return
await state.update_data(cluster_name=cluster_name)
await state.set_state(UserEditorState.selecting_duration)
builder = InlineKeyboardBuilder()
tariffs = await get_tariffs_for_cluster(session, cluster_name)
builder = InlineKeyboardBuilder()
for tariff in tariffs:
months = tariff["duration_days"] // 30
if months < 1:
+1
View File
File diff suppressed because one or more lines are too long