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

Change of rack location via API does not work #18132

Closed
TorstenEhrhardt opened this issue Dec 2, 2024 · 2 comments
Closed

Change of rack location via API does not work #18132

TorstenEhrhardt opened this issue Dec 2, 2024 · 2 comments
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application

Comments

@TorstenEhrhardt
Copy link

TorstenEhrhardt commented Dec 2, 2024

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.7

Python Version

3.11

Steps to Reproduce

  • Create Rack in a site and location
  • facility id is not set (null)
  • send patch request to /api/dcim/racks/:id/ with payload
{
    "location": {
        "name": "Other location",
        "site": {
            "name": "Other site"
        }
    },
    "site": {
        "name": "Other site"
    }
}

or only change location with a global unique location

{
    "location": {
        "name": "Other location"
    }
}

Example performed on https://demo.netbox.dev

grafik

Expected Behavior

Location and site of rack is changed, like it does in the frontend

Observed Behavior

Receiving

{
"non_field_errors": [
"The fields location, facility_id must make a unique set."
]
}

If you set some facility_id in the request it's working, also set the facility_id to null after the location was changed

@TorstenEhrhardt TorstenEhrhardt added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Dec 2, 2024
@jeremystretch
Copy link
Member

This appears to be related to #17810, in which a bug in DRF fails to recognize that one of the fields required by a uniqueness constraints is null.

@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows and removed status: needs triage This issue is awaiting triage by a maintainer labels Dec 2, 2024
@jeremystretch jeremystretch self-assigned this Dec 5, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Dec 5, 2024
@jeremystretch
Copy link
Member

Confirmed that the fix for #17810 has also resolved this issue, so I'm going to reclassify it as a duplicate.

@jeremystretch jeremystretch added status: duplicate This issue has already been raised and removed status: accepted This issue has been accepted for implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows labels Dec 5, 2024
@jeremystretch jeremystretch removed their assignment Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants