mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-20 20:32:25 -06:00
Update startup scripts to update or create records rather than get/create
This commit is contained in:
@@ -13,7 +13,7 @@ with file.open('r') as stream:
|
||||
|
||||
if manufacturers is not None:
|
||||
for params in manufacturers:
|
||||
manufacturer, created = Manufacturer.objects.get_or_create(**params)
|
||||
manufacturer, created = Manufacturer.objects.update_or_create(name=params['name'], defaults=params)
|
||||
|
||||
if created:
|
||||
print("🏭 Created Manufacturer", manufacturer.name)
|
||||
|
||||
Reference in New Issue
Block a user