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):
|
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 = (
|
||||||
.join(billowers, Bill)
|
db.session.query(func.sum(Person.weight))
|
||||||
.filter(Bill.id == self.id))\
|
.join(billowers, Bill)
|
||||||
.scalar()
|
.filter(Bill.id == self.id)
|
||||||
|
).scalar()
|
||||||
return self.amount / weights
|
return self.amount / weights
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in a new issue