Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
sdc50 committed Mar 20, 2024
1 parent 395bbe4 commit 9b7d327
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tethys_portal/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
from tethys_portal.optional_dependencies import optional_import, has_module

# optional imports
bokeh_settings, bokehjs_path = optional_import(
("settings", "bokehjs_path"), from_module="bokeh.settings"
)
bokeh_settings = optional_import("settings", from_module="bokeh.settings")
bokeh_django = optional_import("bokeh_django")

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -407,8 +405,13 @@
STATICFILES_DIRS = [
BASE_DIR / "static",
]
if has_module(bokehjs_path):
STATICFILES_DIRS.append(bokehjs_path())
if has_module(bokeh_settings):
try:
bokeh_js_dir = bokeh_settings.bokehjs_path()
except AttributeError:
# support bokeh versions < 3.4
bokeh_js_dir = bokeh_settings.bokehjsdir()
STATICFILES_DIRS.append(bokeh_js_dir)

STATICFILES_USE_NPM = TETHYS_PORTAL_CONFIG.pop("STATICFILES_USE_NPM", False)
if STATICFILES_USE_NPM:
Expand Down

0 comments on commit 9b7d327

Please sign in to comment.