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:
@@ -14,7 +14,7 @@ with file.open('r') as stream:
|
||||
if tenants is not None:
|
||||
for params in tenants:
|
||||
|
||||
tenant, created = Tenant.objects.get_or_create(**params)
|
||||
tenant, created = Tenant.objects.update_or_create(name=params['name'], defaults=params)
|
||||
|
||||
if created:
|
||||
print("🏠 Created tenant", tenant.name)
|
||||
|
||||
Reference in New Issue
Block a user