Skip to content

Commit

Permalink
new price value
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jun 7, 2016
1 parent 2c259bc commit 9784eed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/budy/models/product.py
Expand Up @@ -202,6 +202,7 @@ def validate(cls):
appier.not_null("gender"),
appier.not_empty("gender"),

appier.not_null("price"),
appier.gte("price", 0.0)
]

Expand Down Expand Up @@ -403,7 +404,7 @@ def pre_save(self):
self.measurements if hasattr(measurement, "price") and\
not measurement.price == None]
self.quantity_hand = sum(quantities_hand) if quantities_hand else None
self.price = max(prices) if prices else None
self.price = max(prices) if prices else 0.0

def related(self, limit = 6):
cls = self.__class__
Expand Down

0 comments on commit 9784eed

Please sign in to comment.