fix referrals and tariff name in key view
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user