Fixes #8425 - Fix exception when viewing change list/records with removed plugins

This commit is contained in:
Daniel Sheppard
2022-02-02 11:18:41 -06:00
parent 98413f0c09
commit 706f6a7525
3 changed files with 8 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ CONFIGCONTEXT_ACTIONS = """
"""
OBJECTCHANGE_OBJECT = """
{% if record.changed_object.get_absolute_url %}
{% if record.changed_object and record.changed_object.get_absolute_url %}
<a href="{{ record.changed_object.get_absolute_url }}">{{ record.object_repr }}</a>
{% else %}
{{ record.object_repr }}

View File

@@ -5,12 +5,14 @@
{% block breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'extras:objectchange_list' %}">Change Log</a></li>
{% if object.related_object.get_absolute_url %}
{% if object.related_object and object.related_object.get_absolute_url %}
<li class="breadcrumb-item"><a href="{{ object.related_object.get_absolute_url }}changelog/">{{ object.related_object }}</a></li>
{% elif object.changed_object.get_absolute_url %}
{% elif object.changed_object and object.changed_object.get_absolute_url %}
<li class="breadcrumb-item"><a href="{{ object.changed_object.get_absolute_url }}changelog/">{{ object.changed_object }}</a></li>
{% elif object.changed_object %}
{% elif object.changed_object and object.changed_object.get_display %}
<li class="breadcrumb-item">{{ object.changed_object }}</li>
{% else %}
<li class="breadcrumb-item">{{ object.object_repr }}</li>
{% endif %}
{% endblock %}
@@ -54,7 +56,7 @@
<tr>
<th scope="row">Object</th>
<td>
{% if object.changed_object.get_absolute_url %}
{% if object.changed_object and object.changed_object.get_absolute_url %}
<a href="{{ object.changed_object.get_absolute_url }}">{{ object.changed_object }}</a>
{% else %}
{{ object.object_repr }}