Skip to content

Conversation

@bctiemann
Copy link
Contributor

Fixes: #18336

Current model validation in Rack.clean() examines the u_height and starting_unit fields but only considers the fields on the Rack itself, not on the RackType if assigned, in which those fields' values override those on the Rack. This can lead to a situation where a Rack with assigned devices above a certain elevation can be assigned to a RackType incompatible with those elevations, because the validation misses the effective u_height and starting_unit of the requested RackType. Subsequent errors occur in SVG rendering and RackForm validation.

This situation is prevented with this change, which ensures that these two fields are validated with consideration of both Rack and RackType values, and assigns the resulting ValidationError to the appropriate form field depending on whether a RackType has been selected or not.

@jeremystretch jeremystretch merged commit 4a1fea3 into main Jan 17, 2025
6 checks passed
@jeremystretch jeremystretch deleted the 18336-validate-rack-height-and-starting-unit branch January 17, 2025 13:45
bctiemann added a commit that referenced this pull request Jan 28, 2025
…ng_unit on rack_type if present (#18395)

* Perform Rack object validation of u_height and starting_unit on rack_type if present

* Calculate effective values before doing validation
bctiemann added a commit that referenced this pull request Jan 29, 2025
…ng_unit on rack_type if present (#18395)

* Perform Rack object validation of u_height and starting_unit on rack_type if present

* Calculate effective values before doing validation
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After changing Rack to use "too small" RackType, not able to change RackType again, remove it, or make other edits to Rack

3 participants