mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Raise exceptions for other inconsistencies when migrating custom field data
Fixes #5573
This commit is contained in:
@ -67,7 +67,7 @@ def migrate_customfieldvalues(apps, schema_editor):
|
|||||||
cf_data = model.objects.filter(pk=cfv.obj_id).values('custom_field_data').first()
|
cf_data = model.objects.filter(pk=cfv.obj_id).values('custom_field_data').first()
|
||||||
try:
|
try:
|
||||||
cf_data['custom_field_data'][cfv.field.name] = deserialize_value(cfv.field, cfv.serialized_value)
|
cf_data['custom_field_data'][cfv.field.name] = deserialize_value(cfv.field, cfv.serialized_value)
|
||||||
except ValueError as e:
|
except Exception as e:
|
||||||
print(f'{cfv.field.name} ({cfv.field.type}): {cfv.serialized_value} ({cfv.pk})')
|
print(f'{cfv.field.name} ({cfv.field.type}): {cfv.serialized_value} ({cfv.pk})')
|
||||||
raise e
|
raise e
|
||||||
model.objects.filter(pk=cfv.obj_id).update(**cf_data)
|
model.objects.filter(pk=cfv.obj_id).update(**cf_data)
|
||||||
|
Reference in New Issue
Block a user