fix(models): Refactor Friend.select to Friend.filter in get_friends_recent_matches() function

This commit is contained in:
Ching 2024-02-08 17:09:01 +08:00
parent 74eec18240
commit 81fc0f28a6

View File

@ -157,7 +157,7 @@ class Friend(BaseModel):
def get_friends_recent_matches():
matches = []
for friend in Friend.select(active=True):
for friend in Friend.filter(active=True):
for match_ in friend.get_recent_matches():
if not Match.select().where(Match.match_id == match_.match_id).exists():
logger.info('create match, match info: %s' % match_.__dict__)