From 11f816a787abe77835821d882007195761be68a0 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 26 May 2023 19:44:32 +1000 Subject: [PATCH] Fix for migration file (#4901) - Catch *all* exceptions when migrating (cherry picked from commit bcd068fc23637d815d7899d549f83b8bd8a26057) --- InvenTree/part/migrations/0111_auto_20230521_1350.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/part/migrations/0111_auto_20230521_1350.py b/InvenTree/part/migrations/0111_auto_20230521_1350.py index 10b1a66f69..26cc04a796 100644 --- a/InvenTree/part/migrations/0111_auto_20230521_1350.py +++ b/InvenTree/part/migrations/0111_auto_20230521_1350.py @@ -41,7 +41,7 @@ def migrate_part_units(apps, schema_editor): try: ureg.Unit(part.units) continue - except pint.errors.UndefinedUnitError: + except Exception: pass # Check a lower-case version @@ -52,7 +52,7 @@ def migrate_part_units(apps, schema_editor): part.save() n_converted += 1 continue - except pint.errors.UndefinedUnitError: + except Exception: pass found = False