Skip to content

Commit

Permalink
also disable in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed May 22, 2024
1 parent 4ed3430 commit 54e89d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
12 changes: 8 additions & 4 deletions api/tacticalrmm/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,21 @@ 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

return self.enable_server_scripts

@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

Expand Down
1 change: 1 addition & 0 deletions api/tacticalrmm/core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
1 change: 1 addition & 0 deletions api/tacticalrmm/tacticalrmm/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 54e89d1

Please sign in to comment.