From 2ef301d7173a4d43d31d1b164f2de3dc201649a8 Mon Sep 17 00:00:00 2001 From: Marcel Vriend <92307684+marcelvriend@users.noreply.github.com> Date: Sat, 24 Dec 2022 22:08:30 +0100 Subject: [PATCH] Convert empty value to None for qu_factor_purchase_to_stock (#257) --- pygrocy/grocy_api_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pygrocy/grocy_api_client.py b/pygrocy/grocy_api_client.py index 3bbf4f6..510bb30 100644 --- a/pygrocy/grocy_api_client.py +++ b/pygrocy/grocy_api_client.py @@ -91,7 +91,7 @@ class ProductData(BaseModel): product_group_id: Optional[int] = None qu_id_stock: int qu_id_purchase: int - qu_factor_purchase_to_stock: float + qu_factor_purchase_to_stock: Optional[float] = None picture_file_name: Optional[str] = None allow_partial_units_in_stock: Optional[bool] = False row_created_timestamp: datetime @@ -100,6 +100,9 @@ class ProductData(BaseModel): location_id_validator = _field_not_empty_validator("location_id") product_group_id_validator = _field_not_empty_validator("product_group_id") + qu_factor_purchase_to_stock_validator = _field_not_empty_validator( + "qu_factor_purchase_to_stock" + ) class ChoreData(BaseModel):