Export Templates produce error #1593

Closed
opened 2025-12-29 16:33:16 +01:00 by adam · 2 comments
Owner

Originally created by @InsaneSplash on GitHub (Mar 1, 2018).

Issue type

[ ] Feature request
[X] Bug report
[ ] Documentation

Environment

  • Python version:
  • NetBox version: 2.3.0

Description

When running an export template against the results of a device search produces the following error.

image

Example:

{% for device in queryset %}{% if device.status and device.primary_ip %}define host{
        host_name               {{ device.name }}
        address                 {{ device.primary_ip.address.ip }}
}
{% endif %}{% endfor %}
Originally created by @InsaneSplash on GitHub (Mar 1, 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: <!-- Example: 3.5.4 --> * NetBox version: 2.3.0 ### Description When running an export template against the results of a device search produces the following error. ![image](https://user-images.githubusercontent.com/16985649/36848514-205e44ee-1d6a-11e8-841e-ac1343d6e5e0.png) Example: ``` {% for device in queryset %}{% if device.status and device.primary_ip %}define host{ host_name {{ device.name }} address {{ device.primary_ip.address.ip }} } {% endif %}{% endfor %} ```
adam added the type: bugstatus: accepted labels 2025-12-29 16:33:16 +01:00
adam closed this issue 2025-12-29 16:33:16 +01:00
Author
Owner

@InsaneSplash commented on GitHub (Mar 1, 2018):

I have tried a number of different templates with some just displaying a name and all produce the same error. This affected 2.2.10 and 2.3

@InsaneSplash commented on GitHub (Mar 1, 2018): I have tried a number of different templates with some just displaying a name and all produce the same error. This affected 2.2.10 and 2.3
Author
Owner

@jeremystretch commented on GitHub (Mar 1, 2018):

Note: This bug is triggered only when the object type has one or more custom fields assigned to it.

@jeremystretch commented on GitHub (Mar 1, 2018): Note: This bug is triggered only when the object type has one or more custom fields assigned to it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1593