Подписки. Полная версия

This commit is contained in:
Vladless
2024-10-30 18:03:04 +03:00
parent 69de84d430
commit 8eb76ff9e4
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ from aiogram.fsm.state import State, StatesGroup
from aiogram.types import (CallbackQuery, InlineKeyboardButton,
InlineKeyboardMarkup, Message)
from auth import link, login_with_credentials
from auth import login_with_credentials, link_subscription
from client import add_client
from config import (ADMIN_PASSWORD, ADMIN_USERNAME, DATABASE_URL,
SERVERS)
@@ -170,7 +170,7 @@ async def handle_key_name_input(message: Message, state: FSMContext):
else:
raise Exception(error_msg)
connection_link = await link(session, server_id, client_id, email)
connection_link = await link_subscription(email, server_id)
conn = await asyncpg.connect(DATABASE_URL)
try:
+2 -2
View File
@@ -4,7 +4,7 @@ from datetime import datetime, timedelta
import asyncpg
from aiogram import Router, types
from auth import link, login_with_credentials
from auth import login_with_credentials, link_subscription
from bot import bot
from client import add_client, delete_client, extend_client_key
from config import ADMIN_PASSWORD, ADMIN_USERNAME, DATABASE_URL, SERVERS
@@ -331,7 +331,7 @@ async def process_callback_select_server(callback_query: types.CallbackQuery):
if not new_client_data:
raise Exception("Ошибка при создании клиента на новом сервере.")
new_key = await link(session_new, server_id, client_id, email)
new_key = await link_subscription(email, server_id)
await conn.execute(
'UPDATE keys SET server_id = $1, key = $2 WHERE client_id = $3',