From 5cda26165b469d133bbf49ec6b15433a1d764b36 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 24 Sep 2024 19:15:22 +0000 Subject: Fix how name/dataset are passed to hmac_creation in Xapian search results Apparently the .data is necessary, because otherwise it passed some "Just" class that is interpreted as a hash or something. This causes an hmac mismatch when you do things like WebGestalt (and presumably other link-outs as well) --- gn2/wqflask/search_results.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gn2/wqflask/search_results.py b/gn2/wqflask/search_results.py index 1d89e52a..e0138b5b 100644 --- a/gn2/wqflask/search_results.py +++ b/gn2/wqflask/search_results.py @@ -28,6 +28,7 @@ from gn2.utility.type_checking import is_str MAX_SEARCH_RESULTS = 50000 # Max number of search results, passed to Xapian search (this needs to match the value in GN3!) + class SearchResultPage: #maxReturn = 3000 @@ -137,7 +138,7 @@ class SearchResultPage: if self.dataset.type == "ProbeSet": trait["hmac"] = (Maybe.apply(hmac) - .to_arguments(trait['name'], trait['dataset'], Just(hmac_creation(f"{trait['name']}:{trait['dataset']}")))) + .to_arguments(trait['name'], trait['dataset'], Just(hmac_creation(f"{trait.data['name']}:{trait.data['dataset']}")))) elif self.dataset.type == "Publish": inbredsetcode = trait.pop("inbredsetcode") if inbredsetcode.map(len) == Just(3): @@ -146,7 +147,7 @@ class SearchResultPage: .to_arguments(inbredsetcode, trait["name"])) trait["hmac"] = (Maybe.apply(hmac) - .to_arguments(trait['name'], trait['dataset'], Just(hmac_creation(f"{trait['name']}:{trait['dataset']}")))) + .to_arguments(trait['name'], trait['dataset'], Just(hmac_creation(f"{trait.data['name']}:{trait.data['dataset']}")))) trait["authors"] = trait["authors_display"] = (trait.pop("authors").map( lambda authors: ", ".join(authors[:2] + ["et al."] if len(authors) >=2 else authors))) -- cgit v1.2.3