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:
@@ -22,7 +22,7 @@ with file.open('r') as stream:
|
||||
if color in color_tpl:
|
||||
params['color'] = color_tpl[0]
|
||||
|
||||
rack_role, created = RackRole.objects.get_or_create(**params)
|
||||
rack_role, created = RackRole.objects.update_or_create(name=params['name'], defaults=params)
|
||||
|
||||
if created:
|
||||
print("🎨 Created rack role", rack_role.name)
|
||||
|
||||
Reference in New Issue
Block a user