From e7acb2bb6318273170483c9aa2bff1a2fba0fa0c Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Mon, 28 Mar 2022 16:02:08 +0200 Subject: [PATCH] Fixing bug in corner case of multi variant annotation (#412) Related-Issue: #412 Projected-Results-Impact: none --- HISTORY.rst | 13 +++++++++++++ variants/views.py | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 20448bbbb..df05b5cfd 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,19 @@ History / Changelog =================== +----------------- +HEAD (unreleased) +----------------- + +End-User Summary +================ + +Full Change List +================ + +- Fixing bug in corner case of multi variant annotation (#412) + + ------- v01.1.1 ------- diff --git a/variants/views.py b/variants/views.py index d79c48e34..0b2960d30 100644 --- a/variants/views.py +++ b/variants/views.py @@ -4123,7 +4123,7 @@ def post(self, *_args, **_kwargs): for variant in variant_list: case = get_object_or_404(Case, sodar_uuid=variant.get("case")) - variant_obj = SmallVariant.objects.get( + variant_obj = SmallVariant.objects.filter( release=variant.get("release"), chromosome=variant.get("chromosome"), start=variant.get("start"), @@ -4131,7 +4131,7 @@ def post(self, *_args, **_kwargs): reference=variant.get("reference"), alternative=variant.get("alternative"), case_id=case.id, - ) + )[0] try: flags = case.small_variant_flags.get(