add handling of None values

This commit is contained in:
Thomas Peetz
2025-06-02 08:53:40 +02:00
parent 767c069404
commit 8e13af5b8c
+4 -1
View File
@@ -72,7 +72,10 @@ def update_item(db: Session, import_data: Dict[AnyStr, Any], item: Any, dry_run:
if update: if update:
log.info(f"update {key}({existing_value}) with {value}") log.info(f"update {key}({existing_value}) with {value}")
if not dry_run: if not dry_run:
setattr(item, str(key), value) if value == 'None':
setattr(item, str(key), None)
else:
setattr(item, str(key), value)
db.add(item) db.add(item)
db.commit() db.commit()