Skip to content

Commit

Permalink
Fix for incorrect received achievements indicator display
Browse files Browse the repository at this point in the history
  • Loading branch information
Arutemu64 committed Sep 13, 2023
1 parent 2774f35 commit 423fa04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/db/repositories/achievement.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from sqlalchemy import select
from sqlalchemy import and_, select
from sqlalchemy.ext.asyncio import AsyncSession

from ..models import Achievement, ReceivedAchievement
Expand Down Expand Up @@ -36,7 +36,10 @@ async def get_achievements_page(
if user_id:
stmt = stmt.outerjoin(
ReceivedAchievement,
Achievement.id == ReceivedAchievement.achievement_id,
and_(
Achievement.id == ReceivedAchievement.achievement_id,
ReceivedAchievement.user_id == user_id,
),
)
return (await self.session.execute(stmt)).all()
else:
Expand Down

0 comments on commit 423fa04

Please sign in to comment.