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:
committed by
Jeremy Stretch
parent
cc3b95bdb0
commit
a566a56a64
@@ -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({
|
||||
|
Reference in New Issue
Block a user