Fix syntax and print data when hook received

This commit is contained in:
Mark Veidemanis 2022-10-15 23:11:01 +01:00
parent a433a4f4b7
commit 62ad699890
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 2 additions and 1 deletions

View File

@ -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")