Skip to content

Commit

Permalink
fixes RelatedObjectDoesNotExist #12367
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Apr 27, 2023
1 parent 72767fb commit a5784a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netbox/netbox/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def clean(self):

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({
Expand Down

0 comments on commit a5784a8

Please sign in to comment.