From 88a7b6ca80f482fc464ce05bab86088dc9e3f1ca Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Fri, 13 Sep 2024 10:21:30 +0300 Subject: Use if statement for clarity. --- gn2/wqflask/views.py | 6 +++--- 1 file 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}") -- cgit v1.2.3