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

'Object is not iterable' when setting a custom field (object) on Object Type through API #16216

Closed
Leon-Pay opened this issue May 21, 2024 · 0 comments · Fixed by #16217
Closed
Assignees
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@Leon-Pay
Copy link

Deployment Type

Self-hosted

NetBox Version

v4.0.2

Python Version

3.11

Steps to Reproduce

Create a virtual machine

Create a custom field for "Virtualization > Virtual Machine" with type Object (Journal Entry)

Create a Journal Entry, ex. on the demo vm1 (361)

Set the custom field to the Journal Entry with the API, it works with the GUI

ex.

curl -X 'PUT' \
  'https://demo.netbox.dev/api/virtualization/virtual-machines/361/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CSRFTOKEN: xxxx' \
  -d '{"custom_fields": {"api_test_custom_field_object": "1"}}'

Expected Behavior

Get repsonse 200, set the journal entry to the custom field

Observed Behavior

Cant add the entry through the api

{
  "error": "argument of type 'JournalEntry' is not iterable",
  "exception": "TypeError",
  "netbox_version": "4.0.2",
  "python_version": "3.10.14"
}
@Leon-Pay Leon-Pay added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels May 21, 2024
@Leon-Pay Leon-Pay changed the title Object is not iterable when setting a custom field (object) on Object Type through API 'Object is not iterable' when setting a custom field (object) on Object Type through API May 21, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for 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 May 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
2 participants