فهرست منبع

Fixes #2378: Corrected "edit" link for virtual machine interfaces

Jeremy Stretch 7 سال پیش
والد
کامیت
aa50e2e385
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 1 0
      CHANGELOG.md
  2. 2 2
      netbox/templates/dcim/interface.html

+ 1 - 0
CHANGELOG.md

@@ -13,6 +13,7 @@ v2.4.4 (FUTURE)
 * [#2369](https://github.com/digitalocean/netbox/issues/2369) - Corrected time zone validation on site API serializer
 * [#2370](https://github.com/digitalocean/netbox/issues/2370) - Redirect to parent device after deleting device bays
 * [#2374](https://github.com/digitalocean/netbox/issues/2374) - Fix toggling display of IP addresses in virtual machine interfaces list
+* [#2378](https://github.com/digitalocean/netbox/issues/2378) - Corrected "edit" link for virtual machine interfaces
 
 ---
 

+ 2 - 2
netbox/templates/dcim/interface.html

@@ -17,12 +17,12 @@
     </div>
     <div class="pull-right">
         {% if perms.dcim.change_interface %}
-            <a href="{% url 'dcim:interface_edit' pk=interface.pk %}" class="btn btn-warning">
+            <a href="{% if interface.device %}{% url 'dcim:interface_edit' pk=interface.pk %}{% else %}{% url 'virtualization:interface_edit' pk=interface.pk %}{% endif %}" class="btn btn-warning">
                 <span class="fa fa-pencil" aria-hidden="true"></span> Edit this interface
             </a>
         {% endif %}
         {% if perms.dcim.delete_interface %}
-            <a href="{% url 'dcim:interface_delete' pk=interface.pk %}" class="btn btn-danger">
+            <a href="{% if interface.device %}{% url 'dcim:interface_delete' pk=interface.pk %}{% else %}{% url 'virtualization:interface_delete' pk=interface.pk %}{% endif %}" class="btn btn-danger">
                 <span class="fa fa-trash" aria-hidden="true"></span> Delete this interface
             </a>
         {% endif %}