Skip to content

Commit 4d62cda

Browse files
committed
[FIX] account_statement_import_online_stripe: store valid json in raw_data.
Storing `tx` directly means `raw_data` would end up containing the stringified python dict, which is not actually JSON and is harder to parse.
1 parent d0e205c commit 4d62cda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

account_statement_import_online_stripe/models/online_bank_statement_provider_stripe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _obtain_statement_data(self, date_since, date_until):
7777
"amount": float(tx["amount"]) / (10**currency.decimal_places),
7878
"date": datetime.fromtimestamp(tx["created"]),
7979
"unique_import_id": tx["id"],
80-
"raw_data": tx,
80+
"raw_data": json.dumps(tx),
8181
}
8282
)
8383
if tx.get("fee"):
@@ -89,7 +89,7 @@ def _obtain_statement_data(self, date_since, date_until):
8989
"amount": float(-tx["fee"]) / (10**currency.decimal_places),
9090
"date": datetime.fromtimestamp(tx["created"]),
9191
"unique_import_id": tx["id"] + "_fee",
92-
"raw_data": tx,
92+
"raw_data": json.dumps(tx),
9393
}
9494
)
9595
return lines, {}

0 commit comments

Comments
 (0)