Refactor and ignore n/a exchange callbacks
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import uuid
|
||||
import orjson
|
||||
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponseBadRequest
|
||||
from django.shortcuts import render
|
||||
|
||||
@@ -78,6 +78,9 @@ class HookAPI(APIView):
|
||||
except Hook.DoesNotExist:
|
||||
return HttpResponseBadRequest("Hook does not exist.")
|
||||
|
||||
if data["exchange"].lower() == "n/a":
|
||||
log.debug("HookAPI callback: exchange is N/A, skipping")
|
||||
return HttpResponse("OK")
|
||||
# Create the callback object
|
||||
callback = Callback.objects.create(hook=hook, **data)
|
||||
callback.save()
|
||||
|
||||
Reference in New Issue
Block a user