From 1685ea94ce1a9123609518bee7f9bcda2d64804e Mon Sep 17 00:00:00 2001 From: augustin64 Date: Wed, 17 Aug 2022 14:17:37 +0200 Subject: [PATCH] =?UTF-8?q?Suppression=20des=20r=C3=A9sultats=20refus?= =?UTF-8?q?=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- partitioncloud/search.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/partitioncloud/search.py b/partitioncloud/search.py index afdc5ad..ea2be5c 100644 --- a/partitioncloud/search.py +++ b/partitioncloud/search.py @@ -64,6 +64,7 @@ def online_search(query): """, (uuid,) ) + db.commit() urllib.request.urlretrieve(element, f"partitioncloud/search-partitions/{uuid}.pdf") os.system( @@ -79,12 +80,19 @@ def online_search(query): "uuid": uuid } ) - db.commit() break except db.IntegrityError: pass except urllib.error.HTTPError as e: print(e) + db.execute( + """ + DELETE FROM search_results (uuid) + VALUES (?) + """, + (uuid,) + ) + db.commit() break return partitions