fix(beatmap,playlist): missing greetlet
This commit is contained in:
@@ -157,8 +157,8 @@ class BeatmapResp(BeatmapBase):
|
|||||||
) -> "BeatmapResp":
|
) -> "BeatmapResp":
|
||||||
from .score import Score
|
from .score import Score
|
||||||
|
|
||||||
beatmap_status = beatmap.beatmap_status
|
|
||||||
beatmap_ = beatmap.model_dump()
|
beatmap_ = beatmap.model_dump()
|
||||||
|
beatmap_status = beatmap_["beatmap_status"]
|
||||||
if query_mode is not None and beatmap.mode != query_mode:
|
if query_mode is not None and beatmap.mode != query_mode:
|
||||||
beatmap_["convert"] = True
|
beatmap_["convert"] = True
|
||||||
beatmap_["is_scoreable"] = beatmap_status.has_leaderboard()
|
beatmap_["is_scoreable"] = beatmap_status.has_leaderboard()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from .lazer_user import User, UserResp
|
|||||||
from .playlist_best_score import PlaylistBestScore
|
from .playlist_best_score import PlaylistBestScore
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
from sqlalchemy.ext.asyncio import AsyncAttrs
|
||||||
from sqlmodel import (
|
from sqlmodel import (
|
||||||
BigInteger,
|
BigInteger,
|
||||||
Column,
|
Column,
|
||||||
@@ -28,7 +29,7 @@ class ItemAttemptsCountBase(SQLModel):
|
|||||||
total_score: int = 0
|
total_score: int = 0
|
||||||
|
|
||||||
|
|
||||||
class ItemAttemptsCount(ItemAttemptsCountBase, table=True):
|
class ItemAttemptsCount(AsyncAttrs, ItemAttemptsCountBase, table=True):
|
||||||
__tablename__ = "item_attempts_count" # pyright: ignore[reportAssignmentType]
|
__tablename__ = "item_attempts_count" # pyright: ignore[reportAssignmentType]
|
||||||
id: int | None = Field(default=None, primary_key=True)
|
id: int | None = Field(default=None, primary_key=True)
|
||||||
|
|
||||||
@@ -105,7 +106,7 @@ class ItemAttemptsResp(ItemAttemptsCountBase):
|
|||||||
) -> "ItemAttemptsResp":
|
) -> "ItemAttemptsResp":
|
||||||
resp = cls.model_validate(item_attempts.model_dump())
|
resp = cls.model_validate(item_attempts.model_dump())
|
||||||
resp.user = await UserResp.from_db(
|
resp.user = await UserResp.from_db(
|
||||||
item_attempts.user,
|
await item_attempts.awaitable_attrs.user,
|
||||||
session=session,
|
session=session,
|
||||||
include=["statistics", "team", "daily_challenge_user_stats"],
|
include=["statistics", "team", "daily_challenge_user_stats"],
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user