mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
remove converted_amount from history when amount is the same
converted_amount is changed along with amount, and should stay the same value converted_amount will change with currency, and we will need it there.
This commit is contained in:
parent
48cbc2b681
commit
f50258f133
1 changed files with 8 additions and 0 deletions
|
@ -105,6 +105,14 @@ def get_history(project, human_readable_names=True):
|
||||||
if removed:
|
if removed:
|
||||||
changeset["owers_removed"] = (None, removed)
|
changeset["owers_removed"] = (None, removed)
|
||||||
|
|
||||||
|
# Remove converted_amount if amount changed in the same way.
|
||||||
|
if (
|
||||||
|
"amount" in changeset
|
||||||
|
and "converted_amount" in changeset
|
||||||
|
and changeset["amount"] == changeset["converted_amount"]
|
||||||
|
):
|
||||||
|
del changeset["converted_amount"]
|
||||||
|
|
||||||
for (prop, (val_before, val_after),) in changeset.items():
|
for (prop, (val_before, val_after),) in changeset.items():
|
||||||
if human_readable_names:
|
if human_readable_names:
|
||||||
if prop == "payer_id":
|
if prop == "payer_id":
|
||||||
|
|
Loading…
Reference in a new issue