Fix callback windows

This commit is contained in:
2022-10-17 07:20:30 +01:00
parent cfeb570bf8
commit 7779cb8d0e
4 changed files with 10 additions and 2 deletions

View File

@@ -41,6 +41,8 @@ class Callbacks(LoginRequiredMixin, View):
callbacks = get_callbacks(hook)
else:
callbacks = get_callbacks(user=request.user)
if type == "page":
type = "modal"
context = {
"title": f"Callbacks ({type})",

View File

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