reformatted using black

All done!  🍰 
1 file reformatted, 19 files left unchanged.
This commit is contained in:
drthrash 2020-02-08 20:40:29 -05:00
parent c0e63bf821
commit c62081a28d

View file

@ -377,10 +377,11 @@ class Bill(db.Model):
def pay_each(self): def pay_each(self):
"""Compute what each share has to pay""" """Compute what each share has to pay"""
if self.owers: if self.owers:
weights = (db.session.query(func.sum(Person.weight)) weights = (
db.session.query(func.sum(Person.weight))
.join(billowers, Bill) .join(billowers, Bill)
.filter(Bill.id == self.id))\ .filter(Bill.id == self.id)
.scalar() ).scalar()
return self.amount / weights return self.amount / weights
else: else:
return 0 return 0