fix(ipam): Add scope fields to "Add Prefix" button

Update the "Add Prefix" button URL in the child prefixes view to pass
`scope_type` and `scope` (replacing the legacy `site` query parameter).
This allows the prefix creation form to inherit the parent prefix scope
and scope type as expected.

Fixes #21262
This commit is contained in:
Martin Hauser
2026-01-27 13:50:18 +01:00
parent 433f46746e
commit 388280e003
+1 -1
View File
@@ -6,7 +6,7 @@
{% include 'ipam/inc/max_depth.html' %} {% include 'ipam/inc/max_depth.html' %}
{% include 'ipam/inc/max_length.html' %} {% include 'ipam/inc/max_length.html' %}
{% if perms.ipam.add_prefix and first_available_prefix %} {% if perms.ipam.add_prefix and first_available_prefix %}
<a href="{% url 'ipam:prefix_add' %}?prefix={{ first_available_prefix }}&vrf={{ object.vrf.pk }}&site={{ object.site.pk }}&tenant_group={{ object.tenant.group.pk }}&tenant={{ object.tenant.pk }}" class="btn btn-primary"> <a href="{% url 'ipam:prefix_add' %}?prefix={{ first_available_prefix }}&vrf={{ object.vrf.pk }}&scope_type={{ object.scope_type.pk }}&scope={{ object.scope.pk }}&tenant_group={{ object.tenant.group.pk }}&tenant={{ object.tenant.pk }}" class="btn btn-primary">
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Prefix" %} <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Prefix" %}
</a> </a>
{% endif %} {% endif %}