IndexError in BasketSummaryView - line.has_discount vs. basket.applied_offers
Description
We hit this "list index out of range" error recently in BasketSummaryView._process_basket_lines, but the offending line of code has not been touched in 2 years. The logic assumes that if a basket line's has_discount property is true then it's applied_offers() will have at least on item. The OpsGenie alert for this was only a a P1 because the 12 occurrences of this constituted a significant percentage of all requests over a 5 minute period.
the offending line:
https://github.com/edx/ecommerce/blame/ee7e9d1c1daa746f53bfb60a6babac4c3e59cdec/ecommerce/extensions/basket/views.py#L286
the OpsGenie alert:
https://app.opsgenie.com/alert#/show/c3c8e35b-a775-4e9b-aaf5-f09333d93dc2-1537726615656/details
the NewRelic link
https://rpm.newrelic.com/accounts/88178/applications/5519285/filterable_errors#/table?top_facet=transactionUiName&barchart=barchart
Steps to Reproduce
Current Behavior
Expected Behavior
Reason for Variance
Release Notes
User Impact Summary
Activity
DUP of
: I don't know if this has additional details you'll need, but please close as duplicate and bring in whatever info is useful. Thank you.
Assignee
Reporter
Labels
Reach
Impact
Platform Area
Customer
Partner Manager
URL
Contributor Name
Groups with Read-Only Access
Actual Points
Category of Work
Platform Map Area (Levels 1 & 2)
Platform Map Area (Levels 3 & 4)
Priority
