fix(beatmap): fail to read beatmapset when using from_resp
This commit is contained in:
@@ -86,7 +86,16 @@ class Beatmap(BeatmapBase, table=True):
|
|||||||
)
|
)
|
||||||
session.add(beatmap)
|
session.add(beatmap)
|
||||||
await session.commit()
|
await session.commit()
|
||||||
await session.refresh(beatmap)
|
beatmap = (
|
||||||
|
await session.exec(
|
||||||
|
select(Beatmap)
|
||||||
|
.options(
|
||||||
|
joinedload(Beatmap.beatmapset).selectinload(Beatmapset.beatmaps) # pyright: ignore[reportArgumentType]
|
||||||
|
)
|
||||||
|
.where(Beatmap.id == resp.id)
|
||||||
|
)
|
||||||
|
).first()
|
||||||
|
assert beatmap is not None, "Beatmap should not be None after commit"
|
||||||
return beatmap
|
return beatmap
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user