diff --git a/CHANGELOG.md b/CHANGELOG.md index c101eb96d..e8cfa7aa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ v2.5.1 (FUTURE) * [#2666](https://github.com/digitalocean/netbox/issues/2666) - Correct display of length unit in cables list * [#2676](https://github.com/digitalocean/netbox/issues/2676) - Fix exception when passing dictionary value to a ChoiceField +* [#2678](https://github.com/digitalocean/netbox/issues/2678) - Fix error when viewing webhook in admin UI without write permission * [#2680](https://github.com/digitalocean/netbox/issues/2680) - Disallow POST requests to `/dcim/interface-connections/` API endpoint --- diff --git a/netbox/extras/admin.py b/netbox/extras/admin.py index e747bf71a..b4962dfd7 100644 --- a/netbox/extras/admin.py +++ b/netbox/extras/admin.py @@ -30,7 +30,8 @@ class WebhookForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - order_content_types(self.fields['obj_type']) + if 'obj_type' in self.fields: + order_content_types(self.fields['obj_type']) @admin.register(Webhook, site=admin_site)