From 9dd31128bbbac9d4cc1f447053abb3655de14089 Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Tue, 13 Sep 2016 13:19:09 +1000 Subject: [PATCH] =?UTF-8?q?Restricts=20=E2=80=98amend=E2=80=99=20product?= =?UTF-8?q?=20widgets=20to=20the=20original=20product.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #76. --- registrasion/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/registrasion/views.py b/registrasion/views.py index c457295f..027dc819 100644 --- a/registrasion/views.py +++ b/registrasion/views.py @@ -826,6 +826,10 @@ def amend_registration(request, user_id): 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( request.POST or None, prefix="voucher",