From 82f6bd3acd87c42275cb93bd8d9bc2cbdc8e9508 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 8 Mar 2023 20:34:48 +0000 Subject: Account for truncated symbol lengths when setting the max_width for the symbol column --- wqflask/wqflask/search_results.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'wqflask') 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])) -- cgit v1.2.3