diff --git a/brewman/static/partial/product-list.html b/brewman/static/partial/product-list.html index 8c6eae0f..58568dbe 100644 --- a/brewman/static/partial/product-list.html +++ b/brewman/static/partial/product-list.html @@ -15,7 +15,7 @@ Code Name Price - Yield + Yield Type Is Active? @@ -25,7 +25,7 @@ {{item.Code}} {{item.Name}} ({{show_extended ? item.Fraction + ' ' + item.FractionUnits + ' = 1 ' : ''}}{{item.Units}}) {{item.Price | currency}} - {{item.ProductYield * 100 | number:2}}% + {{item.ProductYield * 100 | number:2}}% {{item.ProductGroup}} {{item.IsActive}} diff --git a/brewman/views/product.py b/brewman/views/product.py index ce822f8f..bac4262e 100644 --- a/brewman/views/product.py +++ b/brewman/views/product.py @@ -47,10 +47,10 @@ def save(request): try: product_yield = Decimal(json.get('ProductYield', 1)) - if product_yield < 0 or product_yield > 1: - raise ValidationError("Yield must be a decimal >= 0 <= 1") + if product_yield <= 0 or product_yield > 1: + raise ValidationError("Yield must be a decimal > 0 <= 1") except (ValueError, InvalidOperation): - raise ValidationError("Yield must be a decimal >= 0 <= 1") + raise ValidationError("Yield must be a decimal > 0 <= 1") product_group = json.get('ProductGroup', None) if product_group is None: @@ -87,10 +87,10 @@ def update(request): try: item.product_yield = Decimal(request.json_body['ProductYield']) - if item.product_yield < 0 or item.product_yield > 1: - raise ValidationError("Yield must be a decimal >= 0 <= 1") + if item.product_yield <= 0 or item.product_yield > 1: + raise ValidationError("Yield must be a decimal > 0 <= 1") except (ValueError, InvalidOperation): - raise ValidationError("Yield must be a decimal >= 0 <= 1") + raise ValidationError("Yield must be a decimal > 0 <= 1") item.product_group_id = uuid.UUID(request.json_body['ProductGroup']['ProductGroupID']) item.ledger_id = Ledger.all_purchases() diff --git a/development.ini b/development.ini index c059029e..82b0f108 100644 --- a/development.ini +++ b/development.ini @@ -6,8 +6,6 @@ pyramid.debug_authorization = false pyramid.debug_notfound = false pyramid.debug_routematch = false pyramid.default_locale_name = en -# pyramid.includes = -# pyramid_debugtoolbar # sqlalchemy.url = postgresql://hops:123456@localhost:8765/hops sqlalchemy.url = postgresql://postgres:123456@localhost:5432/hops