Skip to content

Commit

Permalink
Merge pull request #94 from zhou13/paypal-nodate
Browse files Browse the repository at this point in the history
Skip paypal transactions that do not contain date entries
  • Loading branch information
jbms committed Feb 14, 2021
2 parents c4c1d8e + 6e26703 commit dc307db
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" entries.
# skip them to avoid validation errors.
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 dc307db

Please sign in to comment.