Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #16786: Clone device location from rack #17508

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

alehaa
Copy link
Contributor

@alehaa alehaa commented Sep 16, 2024

Fixes: #16786

To fix errors when selecting a rack of a child location being not part of the parent location, the site and location are now always copied from the rack when a device is assigned to a rack.

When a device is assigned to a rack, its site and location are cloned
from the rack regardless of user input. This also allows some
consistency checks to be removed, as inconsistent data would still be
overwritten with valid values when saving the Device object.
netbox/dcim/models/devices.py Outdated Show resolved Hide resolved
Instead of an exact match between device and rack location, it is now
sufficient if the device location or one of its children contains the
selected rack.
@alehaa alehaa force-pushed the 16786-device-location-from-rack branch from 59824e4 to add8640 Compare September 18, 2024 18:43
@jeremystretch
Copy link
Member

After re-reading FR #16786 the proposed behavior doesn't seem to be valid. The location to which a device is assigned must match the location of its assigned rack (if any); anything else would be invalid.

Please also see my comment on the FR as it sounds like your use case is better solved by the introduction of new filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add location to rack clone fields
3 participants