Skip to content

Commit 3f766ff

Browse files
committed
Fixes #7474: Fix AttributeError exception when rendering a report or custom script
1 parent 2bd2912 commit 3f766ff

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

docs/release-notes/version-3.0.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# NetBox v3.0
22

3+
## v3.0.7 (FUTURE)
4+
5+
### Bug Fixes
6+
7+
* [#7474](https://github.com/netbox-community/netbox/issues/7474) - Fix AttributeError exception when rendering a report or custom script
8+
9+
---
10+
311
## v3.0.6 (2021-10-06)
412

513
### Enhancements

netbox/templates/extras/report.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
{% block title %}{{ report.name }}{% endblock %}
55

6+
{% block object_identifier %}
7+
{{ report.full_name }}
8+
{% endblock %}
9+
610
{% block breadcrumbs %}
711
<li class="breadcrumb-item"><a href="{% url 'extras:report_list' %}">Reports</a></li>
812
<li class="breadcrumb-item"><a href="{% url 'extras:report_list' %}#module.{{ report.module }}">{{ report.module|bettertitle }}</a></li>

netbox/templates/extras/script.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
{% block title %}{{ script }}{% endblock %}
77

8+
{% block object_identifier %}
9+
{{ script.full_name }}
10+
{% endblock %}
11+
812
{% block breadcrumbs %}
913
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}">Scripts</a></li>
1014
<li class="breadcrumb-item"><a href="{% url 'extras:script_list' %}#module.{{ module }}">{{ module|bettertitle }}</a></li>

netbox/templates/generic/object.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@
99
{# Breadcrumbs #}
1010
<nav class="breadcrumb-container px-3" aria-label="breadcrumb">
1111
<div class="float-end">
12-
<code class="text-muted" title="Object type and ID">
13-
{{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }}
14-
{% if object.slug %}({{ object.slug }}){% endif %}
15-
</code>
12+
<code class="text-muted">
13+
{% block object_identifier %}
14+
{{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }}
15+
{% if object.slug %}({{ object.slug }}){% endif %}
16+
{% endblock object_identifier %}
17+
</code>
1618
</div>
1719
<ol class="breadcrumb">
1820
{% block breadcrumbs %}
1921
<li class="breadcrumb-item"><a href="{% url object|viewname:'list' %}">{{ object|meta:'verbose_name_plural'|bettertitle }}</a></li>
20-
{% endblock %}
22+
{% endblock breadcrumbs %}
2123
</ol>
2224
</nav>
2325
{{ block.super }}

0 commit comments

Comments
 (0)