Sfoglia il codice sorgente

Fixes #3953: Fix validation error when creating child devices

Jeremy Stretch 6 anni fa
parent
commit
439fa731ba
2 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 1 0
      docs/release-notes/version-2.7.md
  2. 1 1
      netbox/dcim/models/__init__.py

+ 1 - 0
docs/release-notes/version-2.7.md

@@ -3,6 +3,7 @@
 ## Bug Fixes
 ## Bug Fixes
 
 
 * [#3951](https://github.com/netbox-community/netbox/issues/3951) - Fix exception in webhook worker due to missing constant
 * [#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
 
 
 ---
 ---
 
 

+ 1 - 1
netbox/dcim/models/__init__.py

@@ -1464,7 +1464,7 @@ class Device(ChangeLoggedModel, ConfigContextModel, CustomFieldModel):
 
 
             try:
             try:
                 # Child devices cannot be assigned to a rack face/unit
                 # 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({
                     raise ValidationError({
                         'face': "Child device types cannot be assigned to a rack face. This is an attribute of the "
                         'face': "Child device types cannot be assigned to a rack face. This is an attribute of the "
                                 "parent device."
                                 "parent device."