mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 11:56:25 -06:00
remove_stale_data() should validate model class
This commit is contained in:
parent
a6384e6c9c
commit
60a4e1fd81
@ -304,7 +304,8 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
|||||||
no longer assigned to a model, or because it has been deleted).
|
no longer assigned to a model, or because it has been deleted).
|
||||||
"""
|
"""
|
||||||
for ct in content_types:
|
for ct in content_types:
|
||||||
ct.model_class().objects.update(
|
if model := ct.model_class():
|
||||||
|
model.objects.update(
|
||||||
custom_field_data=F('custom_field_data') - self.name
|
custom_field_data=F('custom_field_data') - self.name
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user