mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Clean up, update Webhook models
This commit is contained in:
@@ -26,6 +26,10 @@ from .querysets import ConfigContextQuerySet
|
||||
# Webhooks
|
||||
#
|
||||
|
||||
def get_webhook_models():
|
||||
return model_names_to_filter_dict(WEBHOOK_MODELS)
|
||||
|
||||
|
||||
class Webhook(models.Model):
|
||||
"""
|
||||
A Webhook defines a request that will be sent to a remote application when an object is created, updated, and/or
|
||||
@@ -37,7 +41,7 @@ class Webhook(models.Model):
|
||||
to=ContentType,
|
||||
related_name='webhooks',
|
||||
verbose_name='Object types',
|
||||
limit_choices_to={'model__in': WEBHOOK_MODELS},
|
||||
limit_choices_to=get_webhook_models,
|
||||
help_text="The object(s) to which this Webhook applies."
|
||||
)
|
||||
name = models.CharField(
|
||||
|
Reference in New Issue
Block a user