From d37d88e1739c116be36381446f4727af0736a26d Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 10 Sep 2023 19:37:26 +1000 Subject: [PATCH] austax: Gracefully handle assets without acquisition cost when processing multiple CGT adjustment --- austax/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/austax/views.py b/austax/views.py index c7bbf20..0ab8efc 100644 --- a/austax/views.py +++ b/austax/views.py @@ -110,7 +110,9 @@ def cgt_adjustment_multinew(): assets = [] for posting in cgt_postings: - if posting.commodity[:posting.commodity.index('{')].strip() != request.form['commodity']: + if '{' not in posting.commodity and posting.commodity != request.form['commodity']: + continue + if '{' in posting.commodity and posting.commodity[:posting.commodity.index('{')].strip() != request.form['commodity']: continue if posting.quantity >= 0: