Permalink
Browse files

Bugfix: make it possible to uncheck "Active packing" and "Active base…

… price" checkboxes.
  • Loading branch information...
1 parent 5c343f0 commit 18cb4918ee881b852f8c0d3e8d7cdebb00cb7c30 @Zagrebelin Zagrebelin committed with May 15, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lfs/manage/product/product.py
@@ -71,7 +71,7 @@ class ProductDataForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ProductDataForm, self).__init__(*args, **kwargs)
self.fields["template"].widget = SelectImage(choices=PRODUCT_TEMPLATES)
- self.fields["active_base_price"].widget = CheckboxInput()
+ self.fields["active_base_price"].widget = CheckboxInput(check_test=lambda v:v!=0)
man_count = Manufacturer.objects.count()
if man_count > getattr(settings, 'LFS_SELECT_LIMIT', 20):
self.fields["manufacturer"].widget = HiddenInput()
@@ -149,7 +149,7 @@ def __init__(self, *args, **kwargs):
if kwargs.get("instance").is_variant():
self.fields["active_packing_unit"].widget = Select(choices=CHOICES)
else:
- self.fields["active_packing_unit"].widget = CheckboxInput()
+ self.fields["active_packing_unit"].widget = CheckboxInput(check_test=lambda v:v!=0)
def clean(self):
if self.data.get("stock-active_packing_unit") == str(CHOICES_YES):

0 comments on commit 18cb491

Please sign in to comment.