Compare commits

..

5 commits

Author SHA1 Message Date
Yida Chen
a68cebbd3c
Merge 1621a45336 into 05742347c3 2025-01-05 15:49:25 +01:00
singeltary
05742347c3
UI/navigation changes to in "Edit this participant" (#1323)
Some checks are pending
CI / lint (push) Waiting to run
CI / test (mariadb, minimal, 3.11) (push) Blocked by required conditions
CI / test (mariadb, normal, 3.11) (push) Blocked by required conditions
CI / test (mariadb, normal, 3.9) (push) Blocked by required conditions
CI / test (postgresql, minimal, 3.11) (push) Blocked by required conditions
CI / test (postgresql, normal, 3.11) (push) Blocked by required conditions
CI / test (postgresql, normal, 3.9) (push) Blocked by required conditions
CI / test (sqlite, minimal, 3.10) (push) Blocked by required conditions
CI / test (sqlite, minimal, 3.11) (push) Blocked by required conditions
CI / test (sqlite, minimal, 3.12) (push) Blocked by required conditions
CI / test (sqlite, minimal, 3.9) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.10) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.11) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.12) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.9) (push) Blocked by required conditions
CI / docs (push) Waiting to run
Docker build / test (push) Waiting to run
Docker build / build_upload (push) Blocked by required conditions
* Update forms.html

Added navigation element in 'Edit Participants' window

* Update forms.html

Updated button on form for editing participants--"Save" for edits instead of "Add."
2025-01-05 15:49:20 +01:00
chestnutFan
1621a45336
Do not allow the edition of bills involving deactivated users
This is also true for deletion. Once a user is deactivated, all the
related bills shouldn't be able to move.
2025-01-05 15:43:37 +01:00
bd689f931a
Merge branch 'fix-1336' 2025-01-05 13:01:16 +01:00
67938eabbc
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
2025-01-05 13:00:54 +01:00
3 changed files with 8 additions and 7 deletions

View file

@ -760,13 +760,13 @@ class Bill(db.Model):
False if not.
"""
owers_id = [int(m.id) for m in self.owers]
bill_member_id_list = owers_id + [self.payer_id]
deactivated_member_number = (
Person.query.filter(Person.id.in_(bill_member_id_list))
bill_members = owers_id + [self.payer_id]
deactivated_members_count = (
Person.query.filter(Person.id.in_(bill_members))
.filter(Person.activated.is_(False))
.count()
)
return deactivated_member_number != 0
return deactivated_member_count != 0
def __str__(self):
return self.what

View file

@ -236,7 +236,8 @@
{{ input(form.weight) }}
</fieldset>
<div class="actions">
{{ form.submit(class="btn btn-primary") }}
<button class="btn btn-secondary input-group-addon" type="submit">{{ _("Save") }}</button>
<a href="{{ url_for(".list_bills") }}" class="btn btn-outline-secondary"> {{_("Cancel") }} </a>
</div>
{% endmacro %}

View file

@ -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 -%}
@ -61,4 +61,4 @@
{% endblock %}
{# It must be set outside of the block definition #}
{% set messages_shown = True %}
{% set messages_shown = True %}