1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

fixes RelatedObjectDoesNotExist #12367

This commit is contained in:
Abhimanyu Saharan
2023-04-27 22:24:09 +05:30
committed by Jeremy Stretch
parent cc3b95bdb0
commit a566a56a64

View File

@@ -67,8 +67,8 @@ class NetBoxModel(CloningMixin, NetBoxFeatureSet, models.Model):
for field in self._meta.get_fields():
if isinstance(field, GenericForeignKey):
ct_value = getattr(self, field.ct_field)
fk_value = getattr(self, field.fk_field)
ct_value = getattr(self, field.ct_field, None)
fk_value = getattr(self, field.fk_field, None)
if ct_value is None and fk_value is not None:
raise ValidationError({