TypeError when attempting IP address import if only unnamed devices exist #1522

Closed
opened 2025-12-29 16:32:39 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jan 31, 2018).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • NetBox version: 2.2.8

Description

This issue was raised by Joshua Miller on the mailing list.

If at least one of the first three devices in the field queryset (I'm assuming unnamed devices are always returned last) is unnamed, a TypeError is raised by 'example_choices' in netbox/utilities/templatetags/helpers.py, when it attempts to join the name from a unnamed device into the example string. This could potentially impact more than unnamed devices but I didn't dig any deeper.

  File "/opt/netbox/netbox/utilities/templatetags/helpers.py", line 119, in example_choices
    return ', '.join(examples) or 'None'
TypeError: sequence item 2: expected string or Unicode, NoneType found
Originally created by @jeremystretch on GitHub (Jan 31, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [x] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> ### Environment * Python version: 3.5.2 * NetBox version: 2.2.8 ### Description This issue was raised by Joshua Miller on the mailing list. If at least one of the first three devices in the field queryset (I'm assuming unnamed devices are always returned last) is unnamed, a TypeError is raised by 'example_choices' in `netbox/utilities/templatetags/helpers.py`, when it attempts to join the name from a unnamed device into the example string. This could potentially impact more than unnamed devices but I didn't dig any deeper. ``` File "/opt/netbox/netbox/utilities/templatetags/helpers.py", line 119, in example_choices return ', '.join(examples) or 'None' TypeError: sequence item 2: expected string or Unicode, NoneType found ```
adam added the type: bugstatus: accepted labels 2025-12-29 16:32:39 +01:00
adam closed this issue 2025-12-29 16:32:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1522