From 62ad69989065a5606adc19377af6b95512d75b9f Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 15 Oct 2022 23:11:01 +0100 Subject: [PATCH] Fix syntax and print data when hook received --- core/views/hooks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/views/hooks.py b/core/views/hooks.py index af820d9..650db04 100644 --- a/core/views/hooks.py +++ b/core/views/hooks.py @@ -21,6 +21,7 @@ class HookAPI(APIView): parser_classes = [JSONParser] def post(self, request, hook_name): + print("DATA", request.data) try: hook = Hook.objects.get(name=hook_name) except Hook.DoesNotExist: @@ -30,7 +31,7 @@ class HookAPI(APIView): data=request.data, ) callback.save() - hook.received = hook.received += 1 + hook.received = hook.received + 1 hook.save() print("SAVED")