aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2020-09-08 13:40:02 -0500
committerzsloan2020-09-08 13:40:02 -0500
commited8961c7bfe8fcf623b293d021b617a63920a076 (patch)
tree7e0e60b81f3f84d4b3a8b6d5f0e55517d8390ded /wqflask
parent9f76abc95859be4ce7b6b19d51b3b2844c04a197 (diff)
downloadgenenetwork2-ed8961c7bfe8fcf623b293d021b617a63920a076.tar.gz
Search code now checks if there are more than 50,000 results before
running the code that queries the DB for max LRS locus information (which is what takes the most time to run) and sets a variable that indicates to the template (search_results.html) that it shouldn't show the results * wqflask/wqflask/search_results.py - Check number of results from base query in order to prevent certain searches from running too long
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/search_results.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index de4b01eb..f63a84d1 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -79,8 +79,14 @@ views.py).
self.search()
except:
self.search_term_exists = False
+
+ self.too_many_results = False
if self.search_term_exists:
- self.gen_search_result()
+ if len(self.results) > 50000:
+ self.trait_list = []
+ self.too_many_results = True
+ else:
+ self.gen_search_result()
def gen_search_result(self):