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

Default values for object custom fields are not checked for validity #12400

Closed
amhn opened this issue Apr 29, 2023 · 0 comments
Closed

Default values for object custom fields are not checked for validity #12400

amhn opened this issue Apr 29, 2023 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@amhn
Copy link
Contributor

amhn commented Apr 29, 2023

NetBox version

v3.5.0

Python version

3.11

Steps to Reproduce

  1. Create e.g. Prefix
  2. Create Custom-Field with content type Prefix, type object, Object type e.g. IP address and default [1]
  3. Go to previously created prefix

Expected Behavior

Creation of custom field is aborted because default value is not valid for this type. The default value should be an int instead of a list.

Even better: default object is checked for existence. This does not guarantee that the object exists later, because it could be deleted later.

Observed Behavior

Custom field is created and the previously create prefix can not be viewed:
image

If the default value is syntactically correct but the object does not exist, the value for the custom field is displayed as null

Same goes for a multi-object custom field with a single int as default, except for a different error message:
'int' object is not iterable

@amhn amhn added the type: bug A confirmed report of unexpected behavior in the application label Apr 29, 2023
@jeremystretch jeremystretch self-assigned this May 2, 2023
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label May 2, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2023
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

2 participants