From 54e89d11bfb3fe9fbe445b5375f4e89c798d56d1 Mon Sep 17 00:00:00 2001 From: wh1te909 <7434746+wh1te909@users.noreply.github.com> Date: Wed, 22 May 2024 23:37:29 +0000 Subject: [PATCH] also disable in demo --- api/tacticalrmm/core/models.py | 12 ++++++++---- api/tacticalrmm/core/urls.py | 1 + api/tacticalrmm/tacticalrmm/urls.py | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api/tacticalrmm/core/models.py b/api/tacticalrmm/core/models.py index dcb57d802b..c92556e8e7 100644 --- a/api/tacticalrmm/core/models.py +++ b/api/tacticalrmm/core/models.py @@ -189,8 +189,10 @@ def email_is_configured(self) -> bool: @property def server_scripts_enabled(self) -> bool: - if getattr(settings, "HOSTED", False) or getattr( - settings, "TRMM_DISABLE_SERVER_SCRIPTS", False + if ( + getattr(settings, "HOSTED", False) + or getattr(settings, "TRMM_DISABLE_SERVER_SCRIPTS", False) + or getattr(settings, "DEMO", False) ): return False @@ -198,8 +200,10 @@ def server_scripts_enabled(self) -> bool: @property def web_terminal_enabled(self) -> bool: - if getattr(settings, "HOSTED", False) or getattr( - settings, "TRMM_DISABLE_WEB_TERMINAL", False + if ( + getattr(settings, "HOSTED", False) + or getattr(settings, "TRMM_DISABLE_WEB_TERMINAL", False) + or getattr(settings, "DEMO", False) ): return False diff --git a/api/tacticalrmm/core/urls.py b/api/tacticalrmm/core/urls.py index 413c8cbdf4..e87c1f9dcb 100644 --- a/api/tacticalrmm/core/urls.py +++ b/api/tacticalrmm/core/urls.py @@ -29,6 +29,7 @@ if not ( getattr(settings, "HOSTED", False) or getattr(settings, "TRMM_DISABLE_SERVER_SCRIPTS", False) + or getattr(settings, "DEMO", False) ): urlpatterns += [ path("serverscript/test/", views.TestRunServerScript.as_view()), diff --git a/api/tacticalrmm/tacticalrmm/urls.py b/api/tacticalrmm/tacticalrmm/urls.py index dafda9549b..b739a7f6e6 100644 --- a/api/tacticalrmm/tacticalrmm/urls.py +++ b/api/tacticalrmm/tacticalrmm/urls.py @@ -74,6 +74,7 @@ def to_url(self, value): if not ( getattr(settings, "HOSTED", False) or getattr(settings, "TRMM_DISABLE_WEB_TERMINAL", False) + or getattr(settings, "DEMO", False) ): ws_urlpatterns += [ path("ws/trmmcli/", TerminalConsumer.as_asgi()),