kopia lustrzana https://github.com/bugout-dev/moonstream
Change query params check.
rodzic
0b60395120
commit
4e8b4960e9
|
@ -1288,8 +1288,8 @@ def get_leaderboard_positions(
|
||||||
leaderboard_id: uuid.UUID,
|
leaderboard_id: uuid.UUID,
|
||||||
limit: int,
|
limit: int,
|
||||||
offset: int,
|
offset: int,
|
||||||
|
poitns_data: Dict[str, str],
|
||||||
version_number: Optional[int] = None,
|
version_number: Optional[int] = None,
|
||||||
poitns_data: Optional[Dict[str, str]] = None,
|
|
||||||
) -> List[Row[Tuple[uuid.UUID, str, int, str, int]]]:
|
) -> List[Row[Tuple[uuid.UUID, str, int, str, int]]]:
|
||||||
"""
|
"""
|
||||||
Get the leaderboard positions
|
Get the leaderboard positions
|
||||||
|
@ -1325,7 +1325,7 @@ def get_leaderboard_positions(
|
||||||
.filter(LeaderboardVersion.version_number == latest_version)
|
.filter(LeaderboardVersion.version_number == latest_version)
|
||||||
)
|
)
|
||||||
|
|
||||||
if poitns_data:
|
if len(poitns_data) > 0:
|
||||||
|
|
||||||
query = query.filter(
|
query = query.filter(
|
||||||
or_(
|
or_(
|
||||||
|
@ -1336,7 +1336,6 @@ def get_leaderboard_positions(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if limit:
|
if limit:
|
||||||
query = query.limit(limit)
|
query = query.limit(limit)
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ async def leaderboard(
|
||||||
raise EngineHTTPException(status_code=500, detail="Internal server error")
|
raise EngineHTTPException(status_code=500, detail="Internal server error")
|
||||||
|
|
||||||
leaderboard_positions = actions.get_leaderboard_positions(
|
leaderboard_positions = actions.get_leaderboard_positions(
|
||||||
db_session, leaderboard.id, limit, offset, version, points_data
|
db_session, leaderboard.id, limit, offset, points_data, version
|
||||||
)
|
)
|
||||||
|
|
||||||
result = [
|
result = [
|
||||||
|
|
Ładowanie…
Reference in New Issue