Skip to content

Commit

Permalink
new default values
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 18, 2016
1 parent 7adbf1d commit dd5a00a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/budy/models/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def from_omni(cls, merchandise, sub_product, name = "size", currency = "EUR"):

measurement.name = name
measurement.value = value
measurement.quantity_hand = merchandise["stock_on_hand"]
measurement.price = merchandise["retail_price"]
measurement.quantity_hand = merchandise.get("stock_on_hand", 0.0)
measurement.price = merchandise.get("retail_price", 0.0)
measurement.currency = currency
measurement.product = _product
return measurement
Expand Down
4 changes: 2 additions & 2 deletions src/budy/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ def from_omni(cls, merchandise, gender = "Both", currency = "EUR"):
_product.short_description = merchandise["name"] or company_product_code
_product.description = merchandise["description"]
_product.gender = gender
_product.quantity_hand = merchandise["stock_on_hand"]
_product.price = merchandise["retail_price"]
_product.quantity_hand = merchandise.get("stock_on_hand", 0.0)
_product.price = merchandise.get("retail_price", 0.0)
_product.currency = currency
_product.characteristics = metadata.get("characteristics", [])
_product.colors = [_color]
Expand Down

0 comments on commit dd5a00a

Please sign in to comment.