Fixes voucher handling form to not be compulsory
This commit is contained in:
parent
7086ea8729
commit
d50d6bac48
2 changed files with 2 additions and 2 deletions
|
@ -61,5 +61,5 @@ class VoucherForm(forms.Form):
|
||||||
voucher = forms.CharField(
|
voucher = forms.CharField(
|
||||||
label="Voucher code",
|
label="Voucher code",
|
||||||
help_text="If you have a voucher code, enter it here",
|
help_text="If you have a voucher code, enter it here",
|
||||||
required=True,
|
required=False,
|
||||||
)
|
)
|
||||||
|
|
|
@ -33,7 +33,7 @@ def product_category(request, category_id):
|
||||||
cat_form.disable_products_for_user(request.user)
|
cat_form.disable_products_for_user(request.user)
|
||||||
voucher_form = forms.VoucherForm(request.POST, prefix=VOUCHERS_FORM_PREFIX)
|
voucher_form = forms.VoucherForm(request.POST, prefix=VOUCHERS_FORM_PREFIX)
|
||||||
|
|
||||||
if voucher_form.is_valid():
|
if voucher_form.is_valid() and voucher_form.cleaned_data["voucher"].strip():
|
||||||
# Apply voucher
|
# Apply voucher
|
||||||
# leave
|
# leave
|
||||||
voucher = voucher_form.cleaned_data["voucher"]
|
voucher = voucher_form.cleaned_data["voucher"]
|
||||||
|
|
Loading…
Reference in a new issue