|
|
@ -127,6 +127,8 @@ class HookAction(LoginRequiredMixin, APIView):
|
|
|
|
return render(request, template_name, context)
|
|
|
|
return render(request, template_name, context)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
form = HookForm()
|
|
|
|
form = HookForm()
|
|
|
|
|
|
|
|
if type == "page":
|
|
|
|
|
|
|
|
type = "modal"
|
|
|
|
context = {
|
|
|
|
context = {
|
|
|
|
"form": form,
|
|
|
|
"form": form,
|
|
|
|
"hook_id": hook_id,
|
|
|
|
"hook_id": hook_id,
|
|
|
@ -142,6 +144,8 @@ class HookAction(LoginRequiredMixin, APIView):
|
|
|
|
Add or edit a hook.
|
|
|
|
Add or edit a hook.
|
|
|
|
:param hook_id: The id of the hook to edit. Optional.
|
|
|
|
:param hook_id: The id of the hook to edit. Optional.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
if type not in self.allowed_types:
|
|
|
|
|
|
|
|
return HttpResponseBadRequest
|
|
|
|
message = None
|
|
|
|
message = None
|
|
|
|
message_class = "success"
|
|
|
|
message_class = "success"
|
|
|
|
|
|
|
|
|
|
|
@ -187,6 +191,8 @@ class HookAction(LoginRequiredMixin, APIView):
|
|
|
|
Delete a hook.
|
|
|
|
Delete a hook.
|
|
|
|
:param hook_id: The id of the hook to delete.
|
|
|
|
:param hook_id: The id of the hook to delete.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
if type not in self.allowed_types:
|
|
|
|
|
|
|
|
return HttpResponseBadRequest
|
|
|
|
message = None
|
|
|
|
message = None
|
|
|
|
message_class = "success"
|
|
|
|
message_class = "success"
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|