Skip to content

Commit aa566bf

Browse files
committedDec 13, 2024
Add analyses loading to query
1 parent 8f4d056 commit aa566bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎genotype_api/database/crud/update.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ async def refresh_sample_status(
3131
return sample
3232

3333
async def update_sample_comment(self, sample_id: str, comment: str) -> Sample:
34-
query: Query = select(Sample).distinct().filter(Sample.id == sample_id)
34+
query: Query = (
35+
select(Sample).options(selectinload(Sample.analyses)).filter(Sample.id == sample_id)
36+
)
3537
sample: Sample = await self.fetch_one_or_none(query)
38+
3639
if not sample:
3740
raise SampleNotFoundError
41+
3842
sample.comment = comment
3943
self.session.add(sample)
4044
await self.session.commit()

0 commit comments

Comments
 (0)