1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #13622: Fix exception when viewing current config and no revisions have been created

This commit is contained in:
Jeremy Stretch
2023-08-31 08:52:46 -04:00
parent 06f2c6f867
commit 2544e2bf18
3 changed files with 21 additions and 3 deletions

View File

@@ -14,11 +14,11 @@
<div class="controls">
<div class="control-group">
{% plugin_buttons object %}
{% if object.is_active and perms.extras.add_configrevision %}
{% if not object.pk or object.is_active and perms.extras.add_configrevision %}
{% url 'extras:configrevision_add' as edit_url %}
{% include "buttons/edit.html" with url=edit_url %}
{% endif %}
{% if not object.is_active and perms.extras.delete_configrevision %}
{% if object.pk and not object.is_active and perms.extras.delete_configrevision %}
{% delete_button object %}
{% endif %}
</div>
@@ -28,6 +28,14 @@
</div>
{% endblock controls %}
{% block subtitle %}
{% if object.created %}
<div class="object-subtitle">
<span>{% trans "Created" %} {{ object.created|annotated_date }}</span>
</div>
{% endif %}
{% endblock subtitle %}
{% block content %}
<div class="row">
<div class="col col-md-12">