From cea4dffc022c28663bef736f409519e84df741db Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 17 Jan 2020 14:22:58 -0500 Subject: [PATCH] Fixes #3953: Fix validation error when creating child devices --- docs/release-notes/version-2.7.md | 1 + netbox/dcim/models/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-2.7.md b/docs/release-notes/version-2.7.md index fd34742ef..b2aec3201 100644 --- a/docs/release-notes/version-2.7.md +++ b/docs/release-notes/version-2.7.md @@ -3,6 +3,7 @@ ## Bug Fixes * [#3951](https://github.com/netbox-community/netbox/issues/3951) - Fix exception in webhook worker due to missing constant +* [#3953](https://github.com/netbox-community/netbox/issues/3953) - Fix validation error when creating child devices --- diff --git a/netbox/dcim/models/__init__.py b/netbox/dcim/models/__init__.py index ccbdafa83..4ff15141c 100644 --- a/netbox/dcim/models/__init__.py +++ b/netbox/dcim/models/__init__.py @@ -1464,7 +1464,7 @@ class Device(ChangeLoggedModel, ConfigContextModel, CustomFieldModel): try: # Child devices cannot be assigned to a rack face/unit - if self.device_type.is_child_device and self.face is not None: + if self.device_type.is_child_device and self.face: raise ValidationError({ 'face': "Child device types cannot be assigned to a rack face. This is an attribute of the " "parent device."