From dc8753af02592c595ef44dec93e8f321de965d2b Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Thu, 7 Nov 2024 10:17:45 +0100 Subject: [PATCH] Simplify setting hashes Co-authored-by: Nicola Soranzo --- lib/galaxy/model/store/discover.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/galaxy/model/store/discover.py b/lib/galaxy/model/store/discover.py index e5bc3090e37e..043ede46f5ef 100644 --- a/lib/galaxy/model/store/discover.py +++ b/lib/galaxy/model/store/discover.py @@ -930,9 +930,7 @@ def replace_request_syntax_sugar(obj): new_hashes.append({"hash_function": key, "hash_value": obj[key.lower()]}) del obj[key.lower()] - if not obj.get("hashes"): - obj["hashes"] = [] - obj["hashes"].extend(new_hashes) + obj.setdefault("hashes", []).extend(new_hashes) class DiscoveredFile(NamedTuple):