mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-22 11:38:45 -06:00
* Initial work on ObjectChange data migrations * Fix migration bug * Add migrators for MAC address assignments * Update reverting kwarg; allow pop() to fail * Cross-reference MAC address migrators * Split migrator logic across migrations * Add missing migrator
This commit is contained in:
@@ -86,3 +86,15 @@ class Migration(migrations.Migration):
|
||||
new_name='_provider_network',
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def oc_circuittermination_remove_fields(objectchange, reverting):
|
||||
for data in (objectchange.prechange_data, objectchange.postchange_data):
|
||||
if data is not None:
|
||||
data.pop('site', None)
|
||||
data.pop('provider_network', None)
|
||||
|
||||
|
||||
objectchange_migrators = {
|
||||
'circuits.circuittermination': oc_circuittermination_remove_fields,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user