mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
fix: shipping options are not applied when shipping_costs set to 0 #541
This commit is contained in:
committed by
Sebastian Thomschke
parent
3978d85cb4
commit
ebfdbc4313
@@ -93,9 +93,9 @@ class AdPartial(ContextualModel):
|
||||
@field_validator("shipping_costs", mode = "before")
|
||||
@classmethod
|
||||
def _parse_shipping_costs(cls, v:float | int | str) -> Any:
|
||||
if v:
|
||||
return round(parse_decimal(v), 2)
|
||||
return None
|
||||
if v is None or (isinstance(v, str) and not v.strip()):
|
||||
return None
|
||||
return round(parse_decimal(v), 2)
|
||||
|
||||
@field_validator("description")
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user