Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Fix pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bahlo committed Jun 14, 2021
1 parent 0321ef1 commit 32ab588
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ing_ynab/ynab.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ def transform_transactions(
transaction_date = date.today()

milliunits_amount = int(data["amount"].amount * Decimal("1000.0"))
similar_transactions = [x for x in transformed if date.fromisoformat(x["date"]) == transaction_date and x["amount"] == milliunits_amount]
similar_transactions = [
x
for x in transformed
if date.fromisoformat(x["date"]) == transaction_date
and x["amount"] == milliunits_amount
]
occurence = len(similar_transactions) + 1
import_id = f"YNAB:{milliunits_amount}:{transaction_date.isoformat()}:{occurence}"

transformed.append(
{
Expand All @@ -83,7 +89,7 @@ def transform_transactions(
"cleared": "cleared",
"memo": data["purpose"],
"flag_color": self.flag_color,
"import_id": f"YNAB:{milliunits_amount}:{transaction_date.isoformat()}:{occurence}",
"import_id": import_id,
}
)
return transformed

0 comments on commit 32ab588

Please sign in to comment.