Преглед изворни кода

Remain consistent with original action strings (e.g. 'created' instead of 'create')

Jeremy Stretch пре 6 година
родитељ
комит
33890e6b97
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      netbox/extras/webhooks_worker.py

+ 2 - 1
netbox/extras/webhooks_worker.py

@@ -6,6 +6,7 @@ import requests
 from django_rq import job
 from django_rq import job
 from rest_framework.utils.encoders import JSONEncoder
 from rest_framework.utils.encoders import JSONEncoder
 
 
+from .choices import ObjectChangeActionChoices
 from .constants import *
 from .constants import *
 
 
 
 
@@ -15,7 +16,7 @@ def process_webhook(webhook, data, model_name, event, timestamp, username, reque
     Make a POST request to the defined Webhook
     Make a POST request to the defined Webhook
     """
     """
     payload = {
     payload = {
-        'event': event,
+        'event': dict(ObjectChangeActionChoices)[event].lower(),
         'timestamp': timestamp,
         'timestamp': timestamp,
         'model': model_name,
         'model': model_name,
         'username': username,
         'username': username,