feat: Add null check for hostname in Database.py

A null check for the "hostname" field has been added in the Database.py file. This ensures that instances without a hostname are skipped during processing, improving the reliability of the code.
This commit is contained in:
Théophile Diot 2024-08-07 13:22:17 +01:00
parent ffaaf503a0
commit ea1ef434e2
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -3106,6 +3106,9 @@ class Database:
session.query(Instances).filter(Instances.method == method).delete()
for instance in instances:
if instance.get("hostname") is None:
continue
to_put.append(
Instances(
hostname=instance["hostname"],