Skip to content
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

Voucher form needs to be processed first #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamezpolley
Copy link

Because otherwise, the first form (which will not be in a valid start)
throws errors which prevent the voucher form from ever being processed.

I believe this fixes #133

Our logs match those reported there:

  File "/app/symposion_app/vendor/registrasion/registrasion/views.py", line 996, in amend_registration
    current_cart.apply_voucher(voucher_form.cleaned_data["voucher"])
  File "/app/symposion_app/vendor/registrasion/registrasion/controllers/cart.py", line 41, in inner
    return func(self, *a, **k)
  File "/app/symposion_app/vendor/registrasion/registrasion/controllers/cart.py", line 281, in apply_voucher
    voucher = inventory.Voucher.objects.get(code=voucher_code.upper())
  File "/usr/local/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 380, in get
    self.model._meta.object_name

the core problem seems to be trying to operate on the top formset even though the bottom button was clicked

It's possible that simply moving lines 955-969 inf the formset.is_valid() on line 976 would sufficiently resolve the problem too; but this solution is one that I've tested and found to work

Because otherwise, the firstform (which will not be in a valid start)
throws errors which prevent the voucher form from ever being processed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Applying voucher code through "amend" view gives a 500 server error
1 participant