aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/web.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2018-07-16 22:58:48 +0200
committerGitHub <noreply@github.com>2018-07-16 22:58:48 +0200
commit1d0880f3cb39463483a4241197d8eb0d817dffc6 (patch)
treeffb843f74d1d1337a6e66d92b5deb21c0dd9c77e /ihatemoney/web.py
parentc3f8ddd274a40b164b5fceeab44c1c26cf053b04 (diff)
parentf9cc4e56230ce04f58d457bfc8f468d56e53cb36 (diff)
downloadihatemoney-mirror-1d0880f3cb39463483a4241197d8eb0d817dffc6.zip
ihatemoney-mirror-1d0880f3cb39463483a4241197d8eb0d817dffc6.tar.gz
ihatemoney-mirror-1d0880f3cb39463483a4241197d8eb0d817dffc6.tar.bz2
Merge branch 'master' into almet/fix-supervisord-template
Diffstat (limited to 'ihatemoney/web.py')
-rw-r--r--ihatemoney/web.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/ihatemoney/web.py b/ihatemoney/web.py
index 6b1b358..1e16202 100644
--- a/ihatemoney/web.py
+++ b/ihatemoney/web.py
@@ -566,21 +566,9 @@ def settle_bill():
@main.route("/<project_id>/statistics")
def statistics():
"""Compute what each member has paid and spent and display it"""
- members = g.project.active_members
- balance = g.project.balance
- paid = {}
- spent = {}
- for member in members:
- paid[member.id] = sum([bill.amount
- for bill in g.project.get_member_bills(member.id).all()])
- spent[member.id] = sum([bill.pay_each() * member.weight
- for bill in g.project.get_bills().all() if member in bill.owers])
return render_template(
"statistics.html",
- members=members,
- balance=balance,
- paid=paid,
- spent=spent,
+ members_stats=g.project.members_stats,
current_view='statistics',
)