mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-20 04:12:25 -06:00
Update startup scripts to update or create records rather than get/create
This commit is contained in:
@@ -40,7 +40,7 @@ with file.open('r') as stream:
|
||||
|
||||
params[assoc] = model.objects.get(**query)
|
||||
|
||||
rack, created = Rack.objects.get_or_create(**params)
|
||||
rack, created = Rack.objects.update_or_create(name=params['name'], site=params['site'], defaults=params)
|
||||
|
||||
if created:
|
||||
if custom_fields is not None:
|
||||
|
||||
Reference in New Issue
Block a user