From 2ae416ae743498a8fabc644bee727f09bdf6a689 Mon Sep 17 00:00:00 2001
From: jfmosquera <jfmosquera@ebi.ac.uk>
Date: Mon, 18 Nov 2024 02:02:33 +0000
Subject: [PATCH] fix for non similarity sss

---
 api/public/views/elastic_search.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/api/public/views/elastic_search.py b/api/public/views/elastic_search.py
index bc22508..5b4e488 100644
--- a/api/public/views/elastic_search.py
+++ b/api/public/views/elastic_search.py
@@ -218,7 +218,9 @@ class StructureSearchAPI(AdvancedSearchAPIBAse):
     def get(self, request):
         smiles = self.request.query_params.get("smiles", None)
         search_type = self.request.query_params.get("search_type", None)
-        similarity = float(self.request.query_params.get("similarity", None))
+        similarity = self.request.query_params.get("similarity", None)
+        if similarity is not None:
+            similarity = float(similarity)
         structure_search = FullSpecification(
             structure_search=StructureSearch(structure=smiles, type=search_type, similarity=similarity)
         )
-- 
GitLab