mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 11:56:25 -06:00
Invert if/for lines to avoid repetition
This commit is contained in:
parent
ca13500622
commit
4ddfa436b4
@ -1277,9 +1277,9 @@ class Module(PrimaryModel, ConfigContextModel):
|
|||||||
if not disable_replication:
|
if not disable_replication:
|
||||||
create_instances.append(template_instance)
|
create_instances.append(template_instance)
|
||||||
|
|
||||||
for component in create_instances:
|
# Set default values for any applicable custom fields
|
||||||
# Set default values for any applicable custom fields
|
if cf_defaults := CustomField.objects.get_defaults_for_model(component_model):
|
||||||
if cf_defaults := CustomField.objects.get_defaults_for_model(component_model):
|
for component in create_instances:
|
||||||
component.custom_field_data = cf_defaults
|
component.custom_field_data = cf_defaults
|
||||||
|
|
||||||
if component_model is not ModuleBay:
|
if component_model is not ModuleBay:
|
||||||
|
Loading…
Reference in New Issue
Block a user