Skip to content

Commit 2f0a0df

Browse files
author
pitan
committed
fix: correct custom field enablement check
1 parent 94072e0 commit 2f0a0df

File tree

1 file changed

+1
-1
lines changed
  • src/netbox_initializers/initializers

1 file changed

+1
-1
lines changed

src/netbox_initializers/initializers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def set_custom_fields_values(self, entity, custom_field_data):
5252
missing_cfs.append(key)
5353
else:
5454
ct = ObjectType.objects.get_for_model(entity)
55-
if ct not in cf.object_types.all():
55+
if not cf.object_types.filter(pk=ct.pk).exists():
5656
print(
5757
f"⚠️ Custom field {key} is not enabled for {entity}'s model!"
5858
"Please check the 'on_objects' for that custom field in custom_fields.yml"

0 commit comments

Comments
 (0)