Skip to content

Commit

Permalink
Skip paypal transactions that do not contain date entries
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou13 committed Feb 7, 2021
1 parent d811ca0 commit be246d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions beancount_import/source/paypal.py
Expand Up @@ -619,6 +619,10 @@ def prepare(self, journal: JournalEditor, results: SourceResults):
self.log_status('paypal: processing %s' % (path, ))
with open(path, 'r', encoding='utf-8', newline='\n') as f:
txn = json.load(f)
# some old unfinished transactions do not contain "date" entry.
# skip them to avoid validation error.
if "date" not in txn:
continue
jsonschema.validate(txn, transaction_schema)
import_result = self._make_import_result(
txn_id=txn_id, data=txn, json_path=path)
Expand Down

0 comments on commit be246d7

Please sign in to comment.