From 541894d92757659bd291f859211138dbca91ea57 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 15 Oct 2022 22:08:13 +0100 Subject: [PATCH] Make callbacks go on a new page --- core/templates/partials/hook-list.html | 7 ++----- core/views/callbacks.py | 1 - core/views/hooks.py | 6 ++++-- docker/docker-compose.prod.yml | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/core/templates/partials/hook-list.html b/core/templates/partials/hook-list.html index 4ef202c..d59234c 100644 --- a/core/templates/partials/hook-list.html +++ b/core/templates/partials/hook-list.html @@ -42,11 +42,7 @@ - + diff --git a/core/views/callbacks.py b/core/views/callbacks.py index 859d862..30b243c 100644 --- a/core/views/callbacks.py +++ b/core/views/callbacks.py @@ -13,7 +13,6 @@ def get_callbacks(hook=None, user=None): callbacks = Callback.objects.filter(hook__user=user) elif hook: callbacks = Callback.objects.filter(hook=hook) - print("CALLBACKS", callbacks) return callbacks diff --git a/core/views/hooks.py b/core/views/hooks.py index ffd2e4a..b57c310 100644 --- a/core/views/hooks.py +++ b/core/views/hooks.py @@ -21,8 +21,10 @@ class HookAPI(APIView): parser_classes = [JSONParser] def post(self, request, hook_name): - hook = Hook.objects.get(name=hook_name) - print("DATA FREOM POST", request.data) + try: + hook = Hook.objects.get(name=hook_name) + except Hook.DoesNotExist: + return HttpResponseBadRequest("Hook does not exist.") callback = Callback.objects.create( hook=hook, data=request.data, diff --git a/docker/docker-compose.prod.yml b/docker/docker-compose.prod.yml index 2952c4a..c9e60cd 100644 --- a/docker/docker-compose.prod.yml +++ b/docker/docker-compose.prod.yml @@ -7,7 +7,7 @@ services: volumes: - ${PORTAINER_GIT_DIR}:/code # - ${PORTAINER_GIT_DIR}/docker/prod/uwsgi.ini:/conf/uwsgi.ini - - ${APP_LOCAL_SETTINGS}:/code/app/local_settings.py + # - ${APP_LOCAL_SETTINGS}:/code/app/local_settings.py - ${APP_DATABASE_FILE}:/code/db.sqlite3 #ports: # - "8000:8000" # uwsgi socket