Restricts ‘amend’ product widgets to the original product.

Fixes #76.
This commit is contained in:
Christopher Neugebauer 2016-09-13 13:19:09 +10:00
parent a27264ac92
commit 9dd31128bb

View file

@ -826,6 +826,10 @@ def amend_registration(request, user_id):
prefix="products", prefix="products",
) )
for item, form in zip(items, formset):
queryset = inventory.Product.objects.filter(id=item.product.id)
form.fields["product"].queryset = queryset
voucher_form = forms.VoucherForm( voucher_form = forms.VoucherForm(
request.POST or None, request.POST or None,
prefix="voucher", prefix="voucher",