Skip to content

Commit

Permalink
Do not display deactivated users when their balance is really small
Browse files Browse the repository at this point in the history
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
  • Loading branch information
almet committed Dec 27, 2024
1 parent 794f26f commit 46503ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ihatemoney/templates/sidebar_table_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</tr>
</thead>
{%- 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 %}
<tr id="bal-member-{{ member.id }}" action="{% if member.activated %}delete{% else %}reactivate{% endif %}">
<td class="balance-name">{{ member.name }}
{%- if show_weight -%}
Expand Down Expand Up @@ -61,4 +61,4 @@
{% endblock %}

{# It must be set outside of the block definition #}
{% set messages_shown = True %}
{% set messages_shown = True %}

0 comments on commit 46503ac

Please sign in to comment.