diff --git a/handlers/keys/key_view.py b/handlers/keys/key_view.py index 0d060d39..5ed9b39a 100644 --- a/handlers/keys/key_view.py +++ b/handlers/keys/key_view.py @@ -291,14 +291,7 @@ async def render_key_info( traffic_limit = tariff.get("traffic_limit", 0) device_limit = tariff.get("device_limit", 0) - tariff_duration = "" - if tariff and tariff.get("duration_days", 0) > 0: - duration_days = tariff["duration_days"] - if duration_days >= 30: - months = duration_days // 30 - tariff_duration = format_months(months) - else: - tariff_duration = format_days(duration_days) + tariff_duration = tariff_name response_message = key_message( final_link, diff --git a/handlers/refferal.py b/handlers/refferal.py index 12046786..50bfac50 100644 --- a/handlers/refferal.py +++ b/handlers/refferal.py @@ -239,6 +239,9 @@ async def handle_referral_link( return user_exists = await check_user_exists(session, user_id) + if user_exists: + await message.answer("❌ Вы уже зарегистрированы и не можете стать рефералом.") + return if not user_exists: if isinstance(user, dict): await add_user(session=session, **user)