Search hooks by hook name instead of name

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

View File

@ -13,8 +13,8 @@
<tr>
<td>{{ item.id }}</td>
<td>{{ item.user }}</td>
<td><code>{{settings.URL}}/{{settings.HOOK_PATH}}/{{ item.name }}</code></td>
<td>{{ item.hook }}</td>
<td>{{ item.name }}</td>
<td><code>{{settings.URL}}/{{settings.HOOK_PATH}}/{{ item.hook }}</code></td>
<td>{{ item.received }}</td>
<td>
<div class="buttons">

View File

@ -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(