mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #3130: Fix exception when creating a new power outlet
This commit is contained in:
@ -5,6 +5,7 @@ v2.6.0 (FUTURE)
|
|||||||
* [#3123](https://github.com/digitalocean/netbox/issues/3123) - Exempt `/metrics` view from authentication
|
* [#3123](https://github.com/digitalocean/netbox/issues/3123) - Exempt `/metrics` view from authentication
|
||||||
* [#3125](https://github.com/digitalocean/netbox/issues/3125) - Fix exception when viewing PDUs
|
* [#3125](https://github.com/digitalocean/netbox/issues/3125) - Fix exception when viewing PDUs
|
||||||
* [#3126](https://github.com/digitalocean/netbox/issues/3126) - Incorrect calculation of PowerFeed available power
|
* [#3126](https://github.com/digitalocean/netbox/issues/3126) - Incorrect calculation of PowerFeed available power
|
||||||
|
* [#3130](https://github.com/digitalocean/netbox/issues/3130) - Fix exception when creating a new power outlet
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -2006,9 +2006,10 @@ class PowerOutletForm(BootstrapMixin, forms.ModelForm):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
# Limit power_port choices to the local device
|
# Limit power_port choices to the local device
|
||||||
self.fields['power_port'].queryset = PowerPort.objects.filter(
|
if hasattr(self.instance, 'device'):
|
||||||
device=self.instance.device
|
self.fields['power_port'].queryset = PowerPort.objects.filter(
|
||||||
)
|
device=self.instance.device
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class PowerOutletCreateForm(ComponentForm):
|
class PowerOutletCreateForm(ComponentForm):
|
||||||
|
Reference in New Issue
Block a user