Skip to content

Commit

Permalink
Fix getting user daily predictions
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrvsrg committed Jul 4, 2024
1 parent 90e87bf commit d727e3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/bot/middlewares/subscription_limit_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from app.bot.utils.message_utils import (
get_username_from_message,
)
from app.service import user_service
from app.service import statistics_service
from app.config import config


Expand All @@ -16,9 +16,9 @@ def __init__(self):

async def __call__(self, message: Message) -> bool:
username = get_username_from_message(message)
user = user_service.get_user_by_username(username)
statistics = statistics_service.get_statistics(username)

limit_reached = user.daily_predictions >= config.bot.daily_limit
limit_reached = statistics.daily_predictions >= config.bot.daily_limit

if limit_reached:
await message.answer(t("error.subscription_limit"))
Expand Down

0 comments on commit d727e3f

Please sign in to comment.