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

Fixes #15015: Pre-populate assigned tenant when allocating next available IP address under prefix view

Jeremy Stretch 2 лет назад
Родитель
Сommit
8a77ec70f2
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      netbox/templates/ipam/prefix.html

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

@@ -134,7 +134,7 @@
               {% with first_available_ip=object.get_first_available_ip %}
                 {% if first_available_ip %}
                   {% if perms.ipam.add_ipaddress %}
-                    <a href="{% url 'ipam:ipaddress_add' %}?address={{ first_available_ip }}{% if object.vrf %}&vrf={{ object.vrf_id }}{% endif %}">{{ first_available_ip }}</a>
+                    <a href="{% url 'ipam:ipaddress_add' %}?address={{ first_available_ip }}{% if object.vrf %}&vrf={{ object.vrf_id }}{% endif %}{% if object.tenant %}&tenant={{ object.tenant.pk }}{% endif %}">{{ first_available_ip }}</a>
                   {% else %}
                     {{ first_available_ip }}
                   {% endif %}