Resolves #6 — Help text for items without a description is much much nicer

This commit is contained in:
Christopher Neugebauer 2016-04-06 16:45:54 +10:00
parent 4021aa3c8e
commit 812cc0b9c8

View file

@ -47,7 +47,10 @@ class _QuantityBoxProductsForm(_ProductsForm):
@classmethod @classmethod
def set_fields(cls, category, products): def set_fields(cls, category, products):
for product in products: for product in products:
help_text = "$%d -- %s" % (product.price, product.description) if product.description:
help_text = "$%d each -- %s" % (product.price, product.description)
else:
help_text = "$%d each" % product.price
field = forms.IntegerField( field = forms.IntegerField(
label=product.name, label=product.name,