chore: make redis python dep optional (#2470)

This commit is contained in:
Yohan Boniface 2025-02-04 16:38:24 +01:00 committed by GitHub
commit a48513fcd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,10 @@ def _urls_for_js():
Return templated URLs prepared for javascript.
"""
urls = {}
for module in ["umap.urls", "umap.sync.app"]:
modules = ["umap.urls"]
if settings.WEBSOCKET_ENABLED:
modules.append("umap.sync.app")
for module in modules:
names = _get_url_names(module)
urls.update(
dict(zip(names, [get_uri_template(url, module=module) for url in names]))