aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2023-03-08 20:34:48 +0000
committerzsloan2023-03-08 20:35:00 +0000
commit82f6bd3acd87c42275cb93bd8d9bc2cbdc8e9508 (patch)
tree98880a4a4efb1f842baa163c40a9a7467c40ea88 /wqflask
parent22b917d4caf93d73d580163fcdbfb4662d1a61bc (diff)
downloadgenenetwork2-82f6bd3acd87c42275cb93bd8d9bc2cbdc8e9508.tar.gz
Account for truncated symbol lengths when setting the max_width for the symbol column
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/search_results.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index 5019f156..6222dd88 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -204,6 +204,10 @@ class SearchResultPage:
if key == "authors":
authors_string = ",".join(str(trait[key]).split(",")[:2]) + ", et al."
self.max_widths[key] = max(len(authors_string), self.max_widths[key]) if key in self.max_widths else len(str(authors_string))
+ elif key == "symbol":
+ self.max_widths[key] = len(trait[key])
+ if len(trait[key]) > 20:
+ self.max_widths[key] = 20
else:
self.max_widths[key] = max(len(str(trait[key])), self.max_widths[key]) if key in self.max_widths else len(str(trait[key]))