From d198173eb19bc9aa4ffb96b99d3e8ff2a49a5ea9 Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Fri, 5 Jun 2026 17:32:50 +0530 Subject: [PATCH] [feature] Added firmware upgrader websocket routes #534 Added conditional inclusion of websocket routes from openwisp_firmware_upgrader.routing.get_routes() in the Channels routing.py template, gated behind the openwisp2_firmware_upgrader variable. This is required to support real-time upgrade progress tracking via WebSockets, introduced in openwisp/openwisp-firmware-upgrader#320. Closes #534 --- templates/openwisp2/routing.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/openwisp2/routing.py b/templates/openwisp2/routing.py index a3d0b3e4..17a82d36 100644 --- a/templates/openwisp2/routing.py +++ b/templates/openwisp2/routing.py @@ -31,6 +31,12 @@ routes.extend(radius_routes) {% endif %} +{% if openwisp2_firmware_upgrader %} +from openwisp_firmware_upgrader.routing import get_routes as get_upgrader_routes + +routes.extend(get_upgrader_routes()) +{% endif %} + {% for extra_routes in openwisp2_websocket_extra_routes %} routes.extend({{extra_routes}}) {% endfor %}