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
This shouldn't be the case as django-oscar-api is just using the regular django-oscar machinery for applying offers.
In apply_offers, we just call the oscar applicator:
defapply_offers(request, basket):
"Apply offers and discounts to cart"basket.reset_offer_applications()
ifnotbasket.is_empty:
Applicator().apply(basket, request.user, request)
In the default oscar applicator, offers are retrieved by using the active Manager:
defget_site_offers(self):
""" Return site offers that are available to all users """ConditionalOffer=get_model('offer', 'ConditionalOffer')
qs=ConditionalOffer.active.filter(offer_type=ConditionalOffer.SITE)
The active manager makes sure inactive of suspended offers are not queried, see the unit test for this in oscar:
deftest_filters_out_suspended_offers(self):
# Create offer that is available but with the wrong statusfactories.create_offer(
status=models.ConditionalOffer.SUSPENDED)
filtered_offers=models.ConditionalOffer.active.all()
self.assertEqual(0, len(filtered_offers))
Voucher is being applied even if the only offer attached to the that voucher is suspended.
The text was updated successfully, but these errors were encountered: