about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander_Kabui2024-09-13 10:21:30 +0300
committerAlexander_Kabui2024-09-13 10:21:30 +0300
commit88a7b6ca80f482fc464ce05bab86088dc9e3f1ca (patch)
treeb5574b474c8dd9e0c402f66adb35c4a3e85123b8
parent26df13607eec77f35d8f2da28cb88c197fcf1b9c (diff)
downloadgenenetwork2-88a7b6ca80f482fc464ce05bab86088dc9e3f1ca.tar.gz
Use if statement for clarity.
-rw-r--r--gn2/wqflask/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index bcab1187..2c75df41 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -296,11 +296,11 @@ def clean_xapian_query(query: str) -> str:
     query_context = ["genes"]
     cleaned_query_parts = []
     for token in query.split():
-        if token in xapian_operators or any(
-            prefix in token for prefix in range_prefixes if ".." in token
-        ):
+        if token in xapian_operators:
             continue
         prefix, _, suffix = token.partition(":")
+        if ".." in suffix and prefix in range_prefixes:
+            continue
         if prefix in xapian_prefixes:
             query_context.insert(0, prefix)
             cleaned_query_parts.append(f"{prefix} {suffix}")