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:
@@ -29,7 +29,7 @@ with file.open('r') as stream:
|
||||
|
||||
params[assoc] = model.objects.get(**query)
|
||||
|
||||
site, created = Site.objects.get_or_create(**params)
|
||||
site, created = Site.objects.update_or_create(name=params['name'], defaults=params)
|
||||
|
||||
if created:
|
||||
if custom_fields is not None:
|
||||
|
||||
Reference in New Issue
Block a user