We should either pull the sibling discount from the program object or fix the controller to return $0 if no line item exists.
I haven't seen this issue before, which makes we wonder whether there's some other bug going on here where there should always be the sibling discount line item, even when it's zero?
It looks like the stripe credit card module assumes that the sibling discount line item exists: https://github.com/learning-unlimited/ESP-Website/blob/5e7715948d4cf3bc7f91e8562f3aae93ecca13fb/esp/esp/program/modules/handlers/creditcardmodule_stripe.py#L169 https://github.com/learning-unlimited/ESP-Website/blob/5e7715948d4cf3bc7f91e8562f3aae93ecca13fb/esp/esp/accounting/controllers.py#L167-L168
However, when we make a program, if the sibling discount is 0, no line item is created: https://github.com/learning-unlimited/ESP-Website/blob/5e7715948d4cf3bc7f91e8562f3aae93ecca13fb/esp/esp/program/models/__init__.py#L1282-L1291
We should either pull the sibling discount from the program object or fix the controller to return $0 if no line item exists.
I haven't seen this issue before, which makes we wonder whether there's some other bug going on here where there should always be the sibling discount line item, even when it's zero?
Reported by Berkeley.