mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 05:01:48 +02:00
reformatted using black
All done! ✨ 🍰 ✨ 1 file reformatted, 19 files left unchanged.
This commit is contained in:
parent
c0e63bf821
commit
c62081a28d
1 changed files with 5 additions and 4 deletions
|
@ -377,10 +377,11 @@ class Bill(db.Model):
|
|||
def pay_each(self):
|
||||
"""Compute what each share has to pay"""
|
||||
if self.owers:
|
||||
weights = (db.session.query(func.sum(Person.weight))
|
||||
weights = (
|
||||
db.session.query(func.sum(Person.weight))
|
||||
.join(billowers, Bill)
|
||||
.filter(Bill.id == self.id))\
|
||||
.scalar()
|
||||
.filter(Bill.id == self.id)
|
||||
).scalar()
|
||||
return self.amount / weights
|
||||
else:
|
||||
return 0
|
||||
|
|
Loading…
Reference in a new issue