Suppression des résultats refusés

This commit is contained in:
augustin64 2022-08-17 14:17:37 +02:00
parent a7df482f29
commit 1685ea94ce

View File

@ -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