Skip to content

Commit ee6cbdc

Browse files
authored
Fixes #21320: Prevent Rack validation errors when site or optional fields are missing during import (#21321)
1 parent de1c512 commit ee6cbdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netbox/dcim/models/racks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def clean(self):
373373
super().clean()
374374

375375
# Validate location/site assignment
376-
if self.site and self.location and self.location.site != self.site:
376+
if self.site_id and self.location_id and self.location.site_id != self.site_id:
377377
raise ValidationError(_("Assigned location must belong to parent site ({site}).").format(site=self.site))
378378

379379
# Validate outer dimensions and unit

0 commit comments

Comments
 (0)