diff --git a/apps/common/utils.py b/apps/common/utils.py index 5b870c088..7daa449a4 100644 --- a/apps/common/utils.py +++ b/apps/common/utils.py @@ -392,7 +392,10 @@ def get_command_storage_or_create_default_storage(): from common.models import common_settings, Setting name = 'TERMINAL_COMMAND_STORAGE' default = {'default': {'TYPE': 'server'}} - command_storage = common_settings.TERMINAL_COMMAND_STORAGE + try: + command_storage = common_settings.TERMINAL_COMMAND_STORAGE + except Exception: + return default if command_storage is None: obj = Setting() obj.name = name @@ -413,7 +416,10 @@ def get_replay_storage_or_create_default_storage(): from common.models import common_settings, Setting name = 'TERMINAL_REPLAY_STORAGE' default = {'default': {'TYPE': 'server'}} - replay_storage = common_settings.TERMINAL_REPLAY_STORAGE + try: + replay_storage = common_settings.TERMINAL_REPLAY_STORAGE + except Exception: + return default if replay_storage is None: obj = Setting() obj.name = name diff --git a/apps/terminal/backends/__init__.py b/apps/terminal/backends/__init__.py index 1c454a32d..0f0ec0cc5 100644 --- a/apps/terminal/backends/__init__.py +++ b/apps/terminal/backends/__init__.py @@ -3,7 +3,6 @@ from django.conf import settings from .command.serializers import SessionCommandSerializer from common import utils -from common.models import common_settings, Setting TYPE_ENGINE_MAPPING = { 'elasticsearch': 'terminal.backends.command.es',