Fix syntax and print data when hook received
This commit is contained in:
@@ -21,6 +21,7 @@ class HookAPI(APIView):
|
|||||||
parser_classes = [JSONParser]
|
parser_classes = [JSONParser]
|
||||||
|
|
||||||
def post(self, request, hook_name):
|
def post(self, request, hook_name):
|
||||||
|
print("DATA", request.data)
|
||||||
try:
|
try:
|
||||||
hook = Hook.objects.get(name=hook_name)
|
hook = Hook.objects.get(name=hook_name)
|
||||||
except Hook.DoesNotExist:
|
except Hook.DoesNotExist:
|
||||||
@@ -30,7 +31,7 @@ class HookAPI(APIView):
|
|||||||
data=request.data,
|
data=request.data,
|
||||||
)
|
)
|
||||||
callback.save()
|
callback.save()
|
||||||
hook.received = hook.received += 1
|
hook.received = hook.received + 1
|
||||||
hook.save()
|
hook.save()
|
||||||
print("SAVED")
|
print("SAVED")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user