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

#3892: Convert WEBHOOK_MODELS to a Q object

This commit is contained in:
Jeremy Stretch
2020-01-15 16:18:47 -05:00
parent d9437a08f0
commit 215b4d0b3f
6 changed files with 58 additions and 44 deletions

View File

@ -43,10 +43,6 @@ __all__ = (
# 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
@ -58,7 +54,7 @@ class Webhook(models.Model):
to=ContentType,
related_name='webhooks',
verbose_name='Object types',
limit_choices_to=get_webhook_models,
limit_choices_to=WEBHOOK_MODELS,
help_text="The object(s) to which this Webhook applies."
)
name = models.CharField(