We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f4d056 commit aa566bfCopy full SHA for aa566bf
genotype_api/database/crud/update.py
@@ -31,10 +31,14 @@ async def refresh_sample_status(
31
return sample
32
33
async def update_sample_comment(self, sample_id: str, comment: str) -> Sample:
34
- query: Query = select(Sample).distinct().filter(Sample.id == sample_id)
+ query: Query = (
35
+ select(Sample).options(selectinload(Sample.analyses)).filter(Sample.id == sample_id)
36
+ )
37
sample: Sample = await self.fetch_one_or_none(query)
38
+
39
if not sample:
40
raise SampleNotFoundError
41
42
sample.comment = comment
43
self.session.add(sample)
44
await self.session.commit()
0 commit comments