You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: