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

Discount code uses_remaining is never decremented #133

Closed
molokov opened this issue Oct 17, 2013 · 0 comments
Closed

Discount code uses_remaining is never decremented #133

molokov opened this issue Oct 17, 2013 · 0 comments
Labels

Comments

@molokov
Copy link
Contributor

molokov commented Oct 17, 2013

Small bug in Order.complete():
https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/models.py#L474-L501

The fields from self.session_fields are deleted at the top of the function, but we don't get the discount_code out of the session until later in the function - and discount code is one of those deleted as it's listed in self.session_fields.

This way, the uses_remaining field is never decremented when the discount code is used, as it will always be None.

Simple enough to fix by some rearrangement of lines in the function.

Repository owner deleted a comment from github-actions bot Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant