chore: ruff format 4 files
This commit is contained in:
@@ -611,7 +611,9 @@ async def register_email(
|
||||
)
|
||||
|
||||
return {
|
||||
'message': 'Email linked successfully' if not settings.is_cabinet_email_verification_enabled() else 'Verification email sent',
|
||||
'message': 'Email linked successfully'
|
||||
if not settings.is_cabinet_email_verification_enabled()
|
||||
else 'Verification email sent',
|
||||
'email': request.email,
|
||||
}
|
||||
|
||||
|
||||
@@ -63,9 +63,7 @@ async def get_referral_info(
|
||||
# Get withdrawn amount (approved + completed withdrawal requests)
|
||||
withdrawn_query = select(func.coalesce(func.sum(WithdrawalRequest.amount_kopeks), 0)).where(
|
||||
WithdrawalRequest.user_id == user.id,
|
||||
WithdrawalRequest.status.in_(
|
||||
[WithdrawalRequestStatus.APPROVED.value, WithdrawalRequestStatus.COMPLETED.value]
|
||||
),
|
||||
WithdrawalRequest.status.in_([WithdrawalRequestStatus.APPROVED.value, WithdrawalRequestStatus.COMPLETED.value]),
|
||||
)
|
||||
withdrawn_result = await db.execute(withdrawn_query)
|
||||
withdrawn = withdrawn_result.scalar() or 0
|
||||
|
||||
@@ -1406,9 +1406,8 @@ async def get_subscription_renewal_cost(
|
||||
)
|
||||
traffic_price_per_month = settings.get_traffic_price(purchased_traffic)
|
||||
else:
|
||||
traffic_price_per_month = (
|
||||
settings.get_traffic_price(base_traffic_gb)
|
||||
+ settings.get_traffic_price(purchased_traffic)
|
||||
traffic_price_per_month = settings.get_traffic_price(base_traffic_gb) + settings.get_traffic_price(
|
||||
purchased_traffic
|
||||
)
|
||||
else:
|
||||
traffic_price_per_month = settings.get_traffic_price(subscription.traffic_limit_gb)
|
||||
|
||||
@@ -109,9 +109,9 @@ class ThrottlingMiddleware(BaseMiddleware):
|
||||
current = None
|
||||
if current:
|
||||
state_str = str(current)
|
||||
is_ticket_state = (
|
||||
':waiting_for_message' in state_str or ':waiting_for_reply' in state_str
|
||||
) and ('TicketStates' in state_str or 'AdminTicketStates' in state_str)
|
||||
is_ticket_state = (':waiting_for_message' in state_str or ':waiting_for_reply' in state_str) and (
|
||||
'TicketStates' in state_str or 'AdminTicketStates' in state_str
|
||||
)
|
||||
if is_ticket_state:
|
||||
return None
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user