2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

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: try:
ureg.Unit(part.units) ureg.Unit(part.units)
continue continue
except pint.errors.UndefinedUnitError: except Exception:
pass pass
# Check a lower-case version # Check a lower-case version
@ -52,7 +52,7 @@ def migrate_part_units(apps, schema_editor):
part.save() part.save()
n_converted += 1 n_converted += 1
continue continue
except pint.errors.UndefinedUnitError: except Exception:
pass pass
found = False found = False