Resolves #6 — Help text for items without a description is much much nicer
This commit is contained in:
parent
4021aa3c8e
commit
812cc0b9c8
1 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue