mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 19:36:26 -06:00
remove_stale_data() should validate model class
This commit is contained in:
parent
a6384e6c9c
commit
60a4e1fd81
@ -304,9 +304,10 @@ 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():
|
||||||
custom_field_data=F('custom_field_data') - self.name
|
model.objects.update(
|
||||||
)
|
custom_field_data=F('custom_field_data') - self.name
|
||||||
|
)
|
||||||
|
|
||||||
def rename_object_data(self, old_name, new_name):
|
def rename_object_data(self, old_name, new_name):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user