From 828fc4de3e5a6fc8e3d785662f9b340c4caa781b Mon Sep 17 00:00:00 2001 From: MarvinDo Date: Fri, 27 Oct 2023 15:00:17 +0200 Subject: [PATCH] fixed a bug where the user was able to insert ref==alt variants --- src/frontend_celery/webapp/tasks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend_celery/webapp/tasks.py b/src/frontend_celery/webapp/tasks.py index 56626e54..edc106c8 100644 --- a/src/frontend_celery/webapp/tasks.py +++ b/src/frontend_celery/webapp/tasks.py @@ -528,6 +528,9 @@ def validate_and_insert_variant(chrom, pos, ref, alt, genome_build, conn: Connec message = message + "\"" + str(alt) + "\"" elif not pos_is_valid: message = "Position is invalid: " + str(pos) + if ref == alt: + message = "Equal reference and alternative base are not allowed." + alt_is_valid = False if not chrom_is_valid or not ref_is_valid or not alt_is_valid or not pos_is_valid: was_successful = False return was_successful, message, variant_id