mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 12:12:53 -06:00
fixes #2623 - model class being passed to rqworker
This commit is contained in:
parent
232e6f5076
commit
0dcab07519
@ -45,7 +45,7 @@ def enqueue_webhooks(instance, action):
|
|||||||
"extras.webhooks_worker.process_webhook",
|
"extras.webhooks_worker.process_webhook",
|
||||||
webhook,
|
webhook,
|
||||||
serializer.data,
|
serializer.data,
|
||||||
instance.__class__,
|
instance._meta.model_name,
|
||||||
action,
|
action,
|
||||||
str(datetime.datetime.now())
|
str(datetime.datetime.now())
|
||||||
)
|
)
|
||||||
|
@ -10,14 +10,14 @@ from extras.constants import WEBHOOK_CT_JSON, WEBHOOK_CT_X_WWW_FORM_ENCODED, OBJ
|
|||||||
|
|
||||||
|
|
||||||
@job('default')
|
@job('default')
|
||||||
def process_webhook(webhook, data, model_class, event, timestamp):
|
def process_webhook(webhook, data, model_name, event, timestamp):
|
||||||
"""
|
"""
|
||||||
Make a POST request to the defined Webhook
|
Make a POST request to the defined Webhook
|
||||||
"""
|
"""
|
||||||
payload = {
|
payload = {
|
||||||
'event': dict(OBJECTCHANGE_ACTION_CHOICES)[event].lower(),
|
'event': dict(OBJECTCHANGE_ACTION_CHOICES)[event].lower(),
|
||||||
'timestamp': timestamp,
|
'timestamp': timestamp,
|
||||||
'model': model_class._meta.model_name,
|
'model': model_name,
|
||||||
'data': data
|
'data': data
|
||||||
}
|
}
|
||||||
headers = {
|
headers = {
|
||||||
|
Loading…
Reference in New Issue
Block a user