Просмотр исходного кода

Fixes #4952: Default to VM tab when creating/editing an IP address for a VM

Jeremy Stretch 5 лет назад
Родитель
Сommit
bd24eebbf2
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      docs/release-notes/version-2.9.md
  2. 1 1
      netbox/templates/ipam/ipaddress_edit.html

+ 1 - 0
docs/release-notes/version-2.9.md

@@ -17,6 +17,7 @@
 * [#4931](https://github.com/netbox-community/netbox/issues/4931) - Fix DoesNotExist exception when deleting devices
 * [#4938](https://github.com/netbox-community/netbox/issues/4938) - Show add, import buttons on virtual chassis list view
 * [#4939](https://github.com/netbox-community/netbox/issues/4939) - Fix linking to LAG interfaces on other VC members
+* [#4952](https://github.com/netbox-community/netbox/issues/4952) - Default to VM tab when creating/editing an IP address for a VM
 
 ### Other Changes
 

+ 1 - 1
netbox/templates/ipam/ipaddress_edit.html

@@ -33,7 +33,7 @@
             <strong>Interface Assignment</strong>
         </div>
         <div class="panel-body">
-            {% with vm_tab_active=obj.vminterface.exists %}
+            {% with vm_tab_active=form.initial.vminterface %}
                 <ul class="nav nav-tabs" role="tablist">
                     <li role="presentation"{% if not vm_tab_active %} class="active"{% endif %}><a href="#device" role="tab" data-toggle="tab">Device</a></li>
                     <li role="presentation"{% if vm_tab_active %} class="active"{% endif %}><a href="#virtualmachine" role="tab" data-toggle="tab">Virtual Machine</a></li>