-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Applying voucher code through "amend" view gives a 500 server error #133
Comments
For reference, here's the terrible thing I did to work around this in the pyconau website:
IIRC it won't show any confirmation that the voucher code was applied, but if you go to generate and invoice and checkout then it should successfully show the voucher discounts as being applied. |
Thanks for looking into this, Ryan. I'll take a closer look sometime soon.
…On 23 Jul. 2017 13:58, "Ryan Kelly" ***@***.***> wrote:
For reference, here's the terrible thing I did to work around this in the
pyconau website:
- In the "amend cart" HTML page there are two forms, one for "product"
and one for "voucher".
- Use the debug console to copy all the hidden form fields from the
"product" form into the "voucher" form. These carry the metadata about the
form that causes the above traceback if missing.
- Enter the voucher code and submit the modified form.
IIRC it won't show any confirmation that the voucher code was applied, but
if you go to generate and invoice and checkout then it should successfully
show the voucher discounts as being applied.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#133 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAl-3NQVjqRKBq115G5j0vwMIpB_DBKCks5sQ7PWgaJpZM4OgYP2>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I attempted to apply a voucher code to a user using the staff "amend invoice" view, but got the following traceback:
The problem appears to be that the "apply voucher" form does not include any of the metadata about the products form. The formset constructed here is thus invalid:
https://github.com/chrisjrn/registrasion/blob/master/registrasion/views.py#L961
It cannot be iterated over, producing the above traceback.
I managed to work around this on the pyconau2017 site editing the HTML, putting invalid "product" form data in the "voucher" form so that it will pass the above checks and proceed to apply the voucher.
It may be that adding an
if formset.is_valid():
guard around this block of code:https://github.com/chrisjrn/registrasion/blob/master/registrasion/views.py#L967
Will be enough to fix the issue. I'm sorry I don't have the bandwidth to set up a dev environment and dig in and submit a fix as a PR :-(
The text was updated successfully, but these errors were encountered: