Fix for migration file (#4901)

- Catch *all* exceptions when migrating

(cherry picked from commit bcd068fc23637d815d7899d549f83b8bd8a26057)
This commit is contained in:
Oliver 2023-05-26 19:44:32 +10:00 committed by GitHub
parent 01e2376748
commit 11f816a787
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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