From 1ffd078b0c9fc8d238c2d795a102335adb0a8721 Mon Sep 17 00:00:00 2001 From: Archmonger <16909269+Archmonger@users.noreply.github.com> Date: Wed, 15 Dec 2021 03:07:33 -0800 Subject: [PATCH 1/2] Add "name" to WS and Web Module paths --- src/django_idom/paths.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/django_idom/paths.py b/src/django_idom/paths.py index 98170740..184182c3 100644 --- a/src/django_idom/paths.py +++ b/src/django_idom/paths.py @@ -6,7 +6,9 @@ IDOM_WEBSOCKET_PATH = path( - IDOM_WEBSOCKET_URL + "/", IdomAsyncWebsocketConsumer.as_asgi() + IDOM_WEBSOCKET_URL + "/", + IdomAsyncWebsocketConsumer.as_asgi(), + name="idom_websocket", ) """A URL resolver for :class:`IdomAsyncWebsocketConsumer` @@ -17,7 +19,9 @@ IDOM_WEB_MODULES_PATH = path( - IDOM_WEB_MODULES_URL + "", views.web_modules_file + IDOM_WEB_MODULES_URL + "", + views.web_modules_file, + name="idom_web_modules", ) """A URL resolver for static web modules required by IDOM From 6a35479b7accb7d4b86057b38eba90ac8f7b8d14 Mon Sep 17 00:00:00 2001 From: Archmonger <16909269+Archmonger@users.noreply.github.com> Date: Wed, 15 Dec 2021 03:14:58 -0800 Subject: [PATCH 2/2] fix styling error --- src/django_idom/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/django_idom/views.py b/src/django_idom/views.py index 6ee19851..7dd9578a 100644 --- a/src/django_idom/views.py +++ b/src/django_idom/views.py @@ -27,7 +27,6 @@ async def web_modules_file(request: HttpRequest, file: str) -> HttpResponse: file_path = IDOM_WED_MODULES_DIR.current.joinpath(*file.split("/")) return HttpResponse(file_path.read_text(), content_type="text/javascript") - else: _web_module_cache = caches[IDOM_WEB_MODULE_CACHE]