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

Empty search entries are being created for device asset tags #15608

Closed
jeremystretch opened this issue Apr 3, 2024 · 1 comment · Fixed by #15611
Closed

Empty search entries are being created for device asset tags #15608

jeremystretch opened this issue Apr 3, 2024 · 1 comment · Fixed by #15611
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jeremystretch
Copy link
Member

Deployment Type

NetBox Cloud

NetBox Version

v3.7.4

Python Version

3.11

Steps to Reproduce

  1. Create a new device and note its database ID
  2. In the NetBox shell, inspect all search entries associated with it:
ct = ContentType.objects.get_for_model(Device)
device_id = 107
entries = CachedValue.objects.filter(object_type=ct, object_id=device_id)
for entry in entries:
    print(f'{entry.field}: {entry.value}')

Expected Behavior

Only fields which have a meaningful value set should have search entries created.

Observed Behavior

After creating a device with a description, I see three entries for it:

asset_tag: None
name: device1
description: asdasdasd

The value of asset_tag is null.

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Apr 3, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Apr 3, 2024
@jeremystretch
Copy link
Member Author

This bug appears to affect any field which returns a null value (None).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants