From 3cf5b77c95c5e61f383d0d6f763fd4fbc65b1ac0 Mon Sep 17 00:00:00 2001 From: tiksan Date: Tue, 14 Nov 2023 21:38:25 -0800 Subject: [PATCH] Bug fix --- estimate/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/estimate/__init__.py b/estimate/__init__.py index e18c7228..8fce6509 100644 --- a/estimate/__init__.py +++ b/estimate/__init__.py @@ -11,7 +11,7 @@ import pandas as pd from tornium_celery.tasks.user import update_user from tornium_commons import rds -from tornium_commons.models import PersonalStat, User +from tornium_commons.models import PersonalStats, User import xgboost @@ -42,8 +42,8 @@ def estimate_user(user_tid: int, api_key: str) -> typing.Tuple[int, int]: except (ValueError, TypeError): pass - ps: typing.Optional[PersonalStat] = ( - PersonalStat.select().where(PersonalStat.tid == user_tid).order_by(-PersonalStat.timestamp).first() + ps: typing.Optional[PersonalStats] = ( + PersonalStats.select().where(PersonalStats.tid == user_tid).order_by(-PersonalStats.timestamp).first() ) df: pd.DataFrame @@ -64,7 +64,7 @@ def estimate_user(user_tid: int, api_key: str) -> typing.Tuple[int, int]: except Exception: update_error = True - ps = PersonalStat.select().where(PersonalStat.tid == user_tid).order_by(-PersonalStat.timestamp).first() + ps = PersonalStats.select().where(PersonalStats.tid == user_tid).order_by(-PersonalStats.timestamp).first() if ps is None: raise ValueError("Personal stats could not be found in the database")