mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 03:56:53 -06:00
fixes RelatedObjectDoesNotExist #12367
This commit is contained in:
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({
|
||||
|
Loading…
Reference in New Issue
Block a user