Creating a Cluster from the Cluster Group object view pre-populates the Cluster Type field in error #4884

Closed
opened 2025-12-29 19:21:38 +01:00 by adam · 2 comments
Owner

Originally created by @KayOS65 on GitHub (May 6, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.2

Python version

3.8

Steps to Reproduce

Create a Cluster Group
Open the object view for the new Cluster Group - virtualization/cluster-groups/<group_id>/
Click the Add Cluster button

Expected Behavior

The Cluster Group field should be pre-populated. I.e the Add Cluster Link should be virtualization/clusters/add/?group=<group_id>

Observed Behavior

The Cluster Group field is not pre-populated.
The Cluster Type field may be blank or pre-populated it there is a Cluster Type with the same pk as the Cluster Groups.
Create cluster link is virtualization/clusters/add/?type=<group_id>

Originally created by @KayOS65 on GitHub (May 6, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.2 ### Python version 3.8 ### Steps to Reproduce Create a Cluster Group Open the object view for the new Cluster Group - `virtualization/cluster-groups/<group_id>/` Click the Add Cluster button ### Expected Behavior The Cluster Group field should be pre-populated. I.e the Add Cluster Link should be `virtualization/clusters/add/?group=<group_id>` ### Observed Behavior The Cluster Group field is not pre-populated. The Cluster Type field may be blank or pre-populated it there is a Cluster Type with the same pk as the Cluster Groups. Create cluster link is `virtualization/clusters/add/?type=<group_id>`
adam added the type: bugstatus: accepted labels 2025-12-29 19:21:38 +01:00
adam closed this issue 2025-12-29 19:21:38 +01:00
Author
Owner

@KayOS65 commented on GitHub (May 6, 2021):

I'm happy to submit a pull request for this issue but I suspect it would be less work for you @jeremystretch to fix it directly. ;)

diff --git a/netbox/templates/virtualization/clustergroup.html b/netbox/templates/virtualization/clustergroup.html
index 9b208518..badb2b40 100644
--- a/netbox/templates/virtualization/clustergroup.html
+++ b/netbox/templates/virtualization/clustergroup.html
@@ -47,7 +47,7 @@
       {% include 'inc/table.html' with table=clusters_table %}
       {% if perms.virtualization.add_cluster %}
         <div class="panel-footer text-right noprint">
-          <a href="{% url 'virtualization:cluster_add' %}?type={{ object.pk }}" class="btn btn-xs btn-primary">
+          <a href="{% url 'virtualization:cluster_add' %}?group={{ object.pk }}" class="btn btn-xs btn-primary">
             <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add cluster
           </a>
         </div>
@KayOS65 commented on GitHub (May 6, 2021): I'm happy to submit a pull request for this issue but I suspect it would be less work for you @jeremystretch to fix it directly. ;) ``` diff --git a/netbox/templates/virtualization/clustergroup.html b/netbox/templates/virtualization/clustergroup.html index 9b208518..badb2b40 100644 --- a/netbox/templates/virtualization/clustergroup.html +++ b/netbox/templates/virtualization/clustergroup.html @@ -47,7 +47,7 @@ {% include 'inc/table.html' with table=clusters_table %} {% if perms.virtualization.add_cluster %} <div class="panel-footer text-right noprint"> - <a href="{% url 'virtualization:cluster_add' %}?type={{ object.pk }}" class="btn btn-xs btn-primary"> + <a href="{% url 'virtualization:cluster_add' %}?group={{ object.pk }}" class="btn btn-xs btn-primary"> <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add cluster </a> </div> ```
Author
Owner

@jeremystretch commented on GitHub (May 6, 2021):

@KayOS65 thanks but I'll knock it out real quick with some other stuff today.

@jeremystretch commented on GitHub (May 6, 2021): @KayOS65 thanks but I'll knock it out real quick with some other stuff today.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4884