Search hooks by hook name instead of name
This commit is contained in:
parent
62ad699890
commit
a15ebaf82c
|
@ -13,8 +13,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ item.id }}</td>
|
<td>{{ item.id }}</td>
|
||||||
<td>{{ item.user }}</td>
|
<td>{{ item.user }}</td>
|
||||||
<td><code>{{settings.URL}}/{{settings.HOOK_PATH}}/{{ item.name }}</code></td>
|
<td>{{ item.name }}</td>
|
||||||
<td>{{ item.hook }}</td>
|
<td><code>{{settings.URL}}/{{settings.HOOK_PATH}}/{{ item.hook }}</code></td>
|
||||||
<td>{{ item.received }}</td>
|
<td>{{ item.received }}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
|
|
|
@ -23,7 +23,7 @@ class HookAPI(APIView):
|
||||||
def post(self, request, hook_name):
|
def post(self, request, hook_name):
|
||||||
print("DATA", request.data)
|
print("DATA", request.data)
|
||||||
try:
|
try:
|
||||||
hook = Hook.objects.get(name=hook_name)
|
hook = Hook.objects.get(hook=hook_name)
|
||||||
except Hook.DoesNotExist:
|
except Hook.DoesNotExist:
|
||||||
return HttpResponseBadRequest("Hook does not exist.")
|
return HttpResponseBadRequest("Hook does not exist.")
|
||||||
callback = Callback.objects.create(
|
callback = Callback.objects.create(
|
||||||
|
|
Loading…
Reference in New Issue