From d07f9d746a8111069f9b7a6955bf67a909878d96 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 13 Dec 2024 15:58:56 +0530 Subject: [PATCH] refactor: ignore selective malformed json --- .../v15_0/migrate_old_item_wise_tax_detail_data_format.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v15_0/migrate_old_item_wise_tax_detail_data_format.py b/erpnext/patches/v15_0/migrate_old_item_wise_tax_detail_data_format.py index f129896d9da..735420063d4 100644 --- a/erpnext/patches/v15_0/migrate_old_item_wise_tax_detail_data_format.py +++ b/erpnext/patches/v15_0/migrate_old_item_wise_tax_detail_data_format.py @@ -30,9 +30,8 @@ def execute(): item_iterator = json.loads(doc.item_wise_tax_detail).items() except AttributeError as e: # This is stale data from 2009 found in a database - if json.loads(doc.item_wise_tax_detail) == 1: - # meaning: replace with an empty {} - needs_update = True + if isinstance(json.loads(doc.item_wise_tax_detail), int | float): + needs_update = False else: raise e else: