Skip to content

Commit

Permalink
Black
Browse files Browse the repository at this point in the history
  • Loading branch information
KOEPKEJR committed Nov 13, 2023
1 parent 12229d8 commit 49a5f5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions monarchmoney/monarchmoney.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,24 +725,24 @@ async def update_transaction(
}
}

# Special handling as these items can never be null
# Special handling as these items can never be null
if amount:
variables["input"].update({"amount": amount})
if date:
variables["input"].update({"date": date})

# Handling of Booleans parameters
# 'None' should not change the value in the transaction therefore it should not be included in the variables dict
# 'None' should not change the value in the transaction therefore it should not be included in the variables dict
if hide_from_reports is not None:
# Casting the passed value as bool. Therefore, empty strings cast to False and any other value casts to True.
variables["input"].update({"hideFromReports": bool(hide_from_reports)})
if needs_review is not None:
variables["input"].update({"needsReview": bool(needs_review)})

# Ensure that notes is explicitly included to avoid errant erasing of existing notes
if notes is not None:
variables["input"].update({"notes": notes})

# Remaining items
variables["input"].update({"category": category_id})
variables["input"].update({"name": merchant_name})
Expand Down

0 comments on commit 49a5f5e

Please sign in to comment.