2
0
Эх сурвалжийг харах

Merge branch 'develop' into 3898-cable-str-pk

hSaria 6 жил өмнө
parent
commit
736cd709d9

+ 2 - 0
docs/release-notes/version-2.6.md

@@ -15,6 +15,7 @@
 * [#3668](https://github.com/netbox-community/netbox/issues/3668) - Search by DNS name when assigning IP address
 * [#3851](https://github.com/netbox-community/netbox/issues/3851) - Allow passing initial data to custom script forms
 * [#3891](https://github.com/netbox-community/netbox/issues/3891) - Add `local_context_data` filter for virtual machines
+* [#3902](https://github.com/netbox-community/netbox/issues/3902) - Relax the non-essential required fields when connecting cable to circuit or power feed
 
 ## Bug Fixes
 
@@ -29,6 +30,7 @@
 * [#3876](https://github.com/netbox-community/netbox/issues/3876) - Fixed min/max to ASN input field at the site creation page
 * [#3882](https://github.com/netbox-community/netbox/issues/3882) - Fix filtering of devices by rack group
 * [#3898](https://github.com/netbox-community/netbox/issues/3898) - Fix deleted message being set to None for cable 
+* [#3905](https://github.com/netbox-community/netbox/issues/3905) - Fix divide-by-zero on power feeds with low power values
 
 ---
 

+ 4 - 1
netbox/dcim/forms.py

@@ -739,7 +739,7 @@ class RackElevationFilterForm(RackFilterForm):
 
         # Filter the rack field based on the site and group
         self.fields['site'].widget.add_filter_for('id', 'site')
-        self.fields['rack_group_id'].widget.add_filter_for('id', 'group_id')
+        self.fields['group_id'].widget.add_filter_for('id', 'group_id')
 
 
 #
@@ -2804,6 +2804,7 @@ class ConnectCableToCircuitTerminationForm(BootstrapMixin, ChainedFieldsMixin, f
     termination_b_provider = forms.ModelChoiceField(
         queryset=Provider.objects.all(),
         label='Provider',
+        required=False,
         widget=APISelect(
             api_url='/api/circuits/providers/',
             filter_for={
@@ -2857,6 +2858,7 @@ class ConnectCableToPowerFeedForm(BootstrapMixin, ChainedFieldsMixin, forms.Mode
     termination_b_site = forms.ModelChoiceField(
         queryset=Site.objects.all(),
         label='Site',
+        required=False,
         widget=APISelect(
             api_url='/api/dcim/sites/',
             display_field='cid',
@@ -2888,6 +2890,7 @@ class ConnectCableToPowerFeedForm(BootstrapMixin, ChainedFieldsMixin, forms.Mode
             ('rack_group', 'termination_b_rackgroup'),
         ),
         label='Power Panel',
+        required=False,
         widget=APISelect(
             api_url='/api/dcim/power-panels/',
             filter_for={

+ 3 - 1
netbox/templates/dcim/powerfeed.html

@@ -112,7 +112,9 @@
                         {% if utilization %}
                             <td>
                                 {{ utilization.allocated }}VA / {{ powerfeed.available_power }}VA
-                                {% utilization_graph utilization.allocated|percentage:powerfeed.available_power %}
+                                {% if powerfeed.available_power > 0 %}
+                                    {% utilization_graph utilization.allocated|percentage:powerfeed.available_power %}
+                                {% endif %}
                             </td>
                         {% else %}
                             <td class="text-muted">N/A</td>