From a15ebaf82c683245d5b5e9fc5c9fb0a2cead45fd Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 15 Oct 2022 23:13:41 +0100 Subject: [PATCH] Search hooks by hook name instead of name --- core/templates/partials/hook-list.html | 4 ++-- core/views/hooks.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/templates/partials/hook-list.html b/core/templates/partials/hook-list.html index 9b3fea5..3b2aa3a 100644 --- a/core/templates/partials/hook-list.html +++ b/core/templates/partials/hook-list.html @@ -13,8 +13,8 @@ {{ item.id }} {{ item.user }} - {{settings.URL}}/{{settings.HOOK_PATH}}/{{ item.name }} - {{ item.hook }} + {{ item.name }} + {{settings.URL}}/{{settings.HOOK_PATH}}/{{ item.hook }} {{ item.received }}
diff --git a/core/views/hooks.py b/core/views/hooks.py index 650db04..e7c8e78 100644 --- a/core/views/hooks.py +++ b/core/views/hooks.py @@ -23,7 +23,7 @@ class HookAPI(APIView): def post(self, request, hook_name): print("DATA", request.data) try: - hook = Hook.objects.get(name=hook_name) + hook = Hook.objects.get(hook=hook_name) except Hook.DoesNotExist: return HttpResponseBadRequest("Hook does not exist.") callback = Callback.objects.create(