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

Invalid value for custom field when bulk edit VM #5533

Closed
xcdr opened this issue Dec 23, 2020 · 2 comments
Closed

Invalid value for custom field when bulk edit VM #5533

xcdr opened this issue Dec 23, 2020 · 2 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@xcdr
Copy link

xcdr commented Dec 23, 2020

Environment

  • Python version: 3.8.6
  • NetBox version: v2.10.2

Steps to Reproduce

  1. add cusom field vm_id to Virtual Machine (Text, required)
  2. add some VM with different vm_id
  3. select VMs on VM list and click "Edit selected"
  4. change "Tenant" and click "Apply"

Expected Behavior

Tenant should be changed as when I edit single VM.

Observed Behavior

Get validation error:
name_of_first_vm_on_the_list failed validation: {'__all__': ["Invalid value for custom field 'vm_id': Required field cannot be empty."]}

@Mothuizyk
Copy link

I found out it is probably caused by improper bulk edit mechanic. In 2.10.1 as well as 2.10.2 even if editing one field in objects you need to provide values for all of them. Otherwise it defaults to overwriting them to become empty.

As per your example you probably have vm_id marked as required, you didn't provide a value for it because you just want to change "Tenant" so it is empty. Of course requiried field cannot be empty so you get validation error.

@proudbro
Copy link

This incorrect behavior affects not only VM's but other models as well such as Racks. It connects with bulk edit custom fields and after I fill required custom fields again it overwrites other custom fields with empty data.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application labels Dec 28, 2020
@jeremystretch jeremystretch self-assigned this Dec 28, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

4 participants