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

implements #2933 - username in webhooks

This commit is contained in:
John Anderson
2019-03-24 15:31:12 -04:00
parent 3acc8ca3ab
commit 2170eedf08
4 changed files with 8 additions and 5 deletions

View File

@ -10,7 +10,7 @@ from extras.constants import WEBHOOK_CT_JSON, WEBHOOK_CT_X_WWW_FORM_ENCODED, OBJ
@job('default')
def process_webhook(webhook, data, model_name, event, timestamp):
def process_webhook(webhook, data, model_name, event, timestamp, username):
"""
Make a POST request to the defined Webhook
"""
@ -18,6 +18,7 @@ def process_webhook(webhook, data, model_name, event, timestamp):
'event': dict(OBJECTCHANGE_ACTION_CHOICES)[event].lower(),
'timestamp': timestamp,
'model': model_name,
'username': username,
'data': data
}
headers = {