1
0
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:
Jeremy Stretch
2019-05-01 12:02:18 -04:00
parent 346b00e215
commit d4d355dce6
2 changed files with 5 additions and 3 deletions

View File

@ -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
--- ---

View File

@ -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):