Closed joemull closed 7 months ago
The error is caused by the assumption that there will only be one matching band, but this is not a safe assumption:
https://github.com/BirkbeckCTP/consortial_billing/blob/01fc19c36755b2306218986f6bcb5fba301fb822/forms.py#L54-L65
Short term solution: use a try and except to get the latest or create a new one.
Long term solution: add a form test for this case.
The duplicate bands seem to have been created by not using the band form save method in calculate_all_fees. Need to add this and test it.
The error is caused by the assumption that there will only be one matching band, but this is not a safe assumption:
https://github.com/BirkbeckCTP/consortial_billing/blob/01fc19c36755b2306218986f6bcb5fba301fb822/forms.py#L54-L65
Short term solution: use a try and except to get the latest or create a new one.
Long term solution: add a form test for this case.