Closed jpmckinney closed 4 weeks ago
Actually, I'll just make the change in #333
Here's the first assignment:
msme_approved_count = (
session.query(Application.id)
.join(Award, Award.id == Application.award_id)
.join(Borrower, Borrower.id == Application.borrower_id)
.filter(col(Application.lender_completed_at).isnot(None))
.filter(Borrower.size != BorrowerSize.BIG)
.group_by(Application.id)
.count()
)
And the second (retained) one is:
msme_approved_count = (
session.query(Application.id)
.join(Borrower, Borrower.id == Application.borrower_id)
.filter(col(Application.lender_completed_at).isnot(None))
.filter(Borrower.size != BorrowerSize.BIG)
.count()
)
It's assigned two different times, and then used once to construct the return value.
I assume the second one is the correct one, in which case we just delete the first one (and move the code for the second one into the return dict, to prevent this type of bug).