1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #2678: Fix error when viewing webhook in admin UI without write permission

This commit is contained in:
Jeremy Stretch
2018-12-12 09:30:31 -05:00
parent b0a6781623
commit 6460c95e00
2 changed files with 3 additions and 1 deletions

View File

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