Skip to content

Commit f5d6f5d

Browse files
arthansonjeremystretch
authored andcommitted
17406 allow deletion of plugin custom field if plugin removed
1 parent 48ca5d4 commit f5d6f5d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

netbox/extras/models/customfields.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ def remove_stale_data(self, content_types):
294294
no longer assigned to a model, or because it has been deleted).
295295
"""
296296
for ct in content_types:
297-
model = ct.model_class()
298-
if model:
297+
if model := ct.model_class():
299298
instances = model.objects.filter(custom_field_data__has_key=self.name)
300299
for instance in instances:
301300
del instance.custom_field_data[self.name]

0 commit comments

Comments
 (0)