From 67938eabbc3b9c8f1666522c29bdbac71c927275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Fri, 27 Dec 2024 23:59:40 +0100 Subject: [PATCH] Do not display deactivated users when their balance is really small Cases has been reported of rounding issues making deactivated users reapparing. This is due to the fact we're using floats (see #528 for details) Fixes #1336 --- ihatemoney/templates/sidebar_table_layout.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ihatemoney/templates/sidebar_table_layout.html b/ihatemoney/templates/sidebar_table_layout.html index 7450bca15..5aede735f 100644 --- a/ihatemoney/templates/sidebar_table_layout.html +++ b/ihatemoney/templates/sidebar_table_layout.html @@ -11,7 +11,7 @@ {%- endif %} - {%- for member in g.project.members | sort(attribute='name') if member.activated or balance[member.id]|round(2) != 0 %} + {%- for member in g.project.members | sort(attribute='name') if member.activated or balance[member.id]|round(2)|abs > 0.01 %} {{ member.name }} {%- if show_weight -%} @@ -61,4 +61,4 @@ {% endblock %} {# It must be set outside of the block definition #} -{% set messages_shown = True %} \ No newline at end of file +{% set messages_shown = True %}