1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

Correct bug in members model. The has_bills method did not worked as expected. Fix #73.

This commit is contained in:
Frédéric Sureau 2012-01-28 12:40:10 +01:00
parent a59465c9a5
commit caf9b6fcc2

View file

@ -110,7 +110,7 @@ class Person(db.Model):
def has_bills(self):
"""return if the user do have bills or not"""
bills_as_ower_number = db.session.query(billowers)\
.filter(billowers.columns.get("bill_id") == self.id)\
.filter(billowers.columns.get("person_id") == self.id)\
.count()
return bills_as_ower_number != 0 or len(self.bills) != 0