diff options
author | zsloan | 2024-09-24 19:15:22 +0000 |
---|---|---|
committer | zsloan | 2024-09-24 19:15:22 +0000 |
commit | 5cda26165b469d133bbf49ec6b15433a1d764b36 (patch) | |
tree | d8d14102afefee719d2935c0279c51a3f3a60e80 /gn2/wqflask | |
parent | 8727915cfa878168e32bc3006a3c8ca993655155 (diff) | |
download | genenetwork2-5cda26165b469d133bbf49ec6b15433a1d764b36.tar.gz |
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)
Diffstat (limited to 'gn2/wqflask')
-rw-r--r-- | gn2/wqflask/search_results.py | 5 |
1 files 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))) |