Skip to content

Object of type User is not JSON serializable #16973

Closed
@papounaise

Description

@papounaise

Deployment Type

Self-hosted

NetBox Version

v3.7.6

Python Version

3.12

Steps to Reproduce

I created a custom_field for device roles content type named "created_by" .
It accepts Users > User as object type.
After I have created a permission with {"custom_field_data__created_by": "$user"} as constraint, I get 'Object of type User is not JSON serializable' when I try to either change or delete a device role created by myself. Putting my user id instead of "$user" works as expected.

Expected Behavior

Constraint with {"custom_field_data__created_by": "$user"} should recognize the User token

Observed Behavior

The user token "$user" is not recognized and I get 'Object of type User is not JSON serializable'

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions