diff options
author | Alexander_Kabui | 2024-09-13 10:21:30 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-09-13 10:21:30 +0300 |
commit | 88a7b6ca80f482fc464ce05bab86088dc9e3f1ca (patch) | |
tree | b5574b474c8dd9e0c402f66adb35c4a3e85123b8 /gn2 | |
parent | 26df13607eec77f35d8f2da28cb88c197fcf1b9c (diff) | |
download | genenetwork2-88a7b6ca80f482fc464ce05bab86088dc9e3f1ca.tar.gz |
Use if statement for clarity.
Diffstat (limited to 'gn2')
-rw-r--r-- | gn2/wqflask/views.py | 6 |
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}") |