From 56cd2574741500762d7afb507b4a7f1f9c680c4b Mon Sep 17 00:00:00 2001 From: Ross Date: Wed, 17 Jun 2026 22:04:20 +0100 Subject: [PATCH] Fix clearable text area setup and update routing for multiuser websocket --- anatomy/static/js/anatomy.js | 2 ++ entrypoint.sh | 17 +++++++++++------ generic/routing.py | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/anatomy/static/js/anatomy.js b/anatomy/static/js/anatomy.js index 82b9f606..d9edcec0 100644 --- a/anatomy/static/js/anatomy.js +++ b/anatomy/static/js/anatomy.js @@ -226,7 +226,9 @@ function clearableTextAreaSetup() { textFields.forEach((field) => { const wrapper = field.closest(".position-relative"); + if (!wrapper) return; const clearButton = wrapper.querySelector(".clear-input-button"); + if (!clearButton) return; // Function to toggle the visibility of the clear button const toggleClearButton = () => { diff --git a/entrypoint.sh b/entrypoint.sh index 07db988d..cf488e3c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,9 +17,14 @@ python manage.py migrate --noinput echo "Collecting static files..." python manage.py collectstatic --noinput -echo "Starting gunicorn..." -exec gunicorn rad.wsgi:application \ - --name rad_gunicorn \ - --bind 0.0.0.0:8000 \ - --workers ${GUNICORN_WORKERS:-3} \ - --log-level ${GUNICORN_LOGLEVEL:-info} +if [ "${SERVER_TYPE}" = "daphne" ] || [ "${SERVER_TYPE}" = "asgi" ]; then + echo "Starting daphne..." + exec daphne -b 0.0.0.0 -p 8000 rad.asgi:application +else + echo "Starting gunicorn..." + exec gunicorn rad.wsgi:application \ + --name rad_gunicorn \ + --bind 0.0.0.0:8000 \ + --workers ${GUNICORN_WORKERS:-3} \ + --log-level ${GUNICORN_LOGLEVEL:-info} +fi diff --git a/generic/routing.py b/generic/routing.py index 2f9fce66..055b2cae 100644 --- a/generic/routing.py +++ b/generic/routing.py @@ -2,5 +2,5 @@ from django.urls import re_path from . import consumers websocket_urlpatterns = [ - re_path(r'^/ws/multiuser/(?P[\w-]+)/$', consumers.MultiuserConsumer.as_asgi()), + re_path(r'^/?ws/multiuser/(?P[\w-]+)/$', consumers.MultiuserConsumer.as_asgi()), ]