PR #6641 breaks text custom field default value #5082

Closed
opened 2025-12-29 19:23:54 +01:00 by adam · 1 comment
Owner

Originally created by @bmhughes on GitHub (Jul 21, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.9

Python version

3.9

Steps to Reproduce

  1. Create a custom text type field.
  2. Try to set a default value.

Expected Behavior

Default value should be set.

Observed Behavior

ValidationError is raised because .validate for a text field tests against str when the field is a django.forms.fields.JSONString, trying to set a str value causes a Enter a valid JSON. error.

Originally created by @bmhughes on GitHub (Jul 21, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.9 ### Python version 3.9 ### Steps to Reproduce 1. Create a custom text type field. 2. Try to set a default value. ### Expected Behavior Default value should be set. ### Observed Behavior `ValidationError` is raised because `.validate` for a text field tests against `str` when the field is a `django.forms.fields.JSONString`, trying to set a `str` value causes a `Enter a valid JSON.` error.
adam added the type: bugstatus: accepted labels 2025-12-29 19:23:54 +01:00
adam closed this issue 2025-12-29 19:23:54 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 21, 2021):

Linking this to #6641

@jeremystretch commented on GitHub (Jul 21, 2021): Linking this to #6641
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5082