mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-03 22:06:26 -06:00
Fixes #21320: Prevent Rack validation errors when site or optional fields are missing during import (#21321)
CI / build (20.x, 3.12) (push) Failing after 18s
CI / build (20.x, 3.13) (push) Failing after 14s
CI / build (20.x, 3.14) (push) Failing after 12s
CodeQL / Analyze (actions) (push) Failing after 24s
CodeQL / Analyze (javascript-typescript) (push) Failing after 30s
CodeQL / Analyze (python) (push) Failing after 27s
CI / build (20.x, 3.12) (push) Failing after 18s
CI / build (20.x, 3.13) (push) Failing after 14s
CI / build (20.x, 3.14) (push) Failing after 12s
CodeQL / Analyze (actions) (push) Failing after 24s
CodeQL / Analyze (javascript-typescript) (push) Failing after 30s
CodeQL / Analyze (python) (push) Failing after 27s
This commit is contained in:
@@ -373,7 +373,7 @@ class Rack(ContactsMixin, ImageAttachmentsMixin, TrackingModelMixin, RackBase):
|
|||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
# Validate location/site assignment
|
# Validate location/site assignment
|
||||||
if self.site and self.location and self.location.site != self.site:
|
if self.site_id and self.location_id and self.location.site_id != self.site_id:
|
||||||
raise ValidationError(_("Assigned location must belong to parent site ({site}).").format(site=self.site))
|
raise ValidationError(_("Assigned location must belong to parent site ({site}).").format(site=self.site))
|
||||||
|
|
||||||
# Validate outer dimensions and unit
|
# Validate outer dimensions and unit
|
||||||
|
|||||||
Reference in New Issue
Block a user