From 1bfef829f3c0ae2550bf8f1dff721c0137cb825e Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Wed, 24 Oct 2018 10:11:38 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9terminal=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E8=8E=B7=E5=8F=96storage,=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/forms.py | 12 ------------ apps/terminal/forms.py | 10 ++-------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/apps/common/forms.py b/apps/common/forms.py index 491ae779a..10ac4ec17 100644 --- a/apps/common/forms.py +++ b/apps/common/forms.py @@ -147,18 +147,6 @@ class TerminalSettingForm(BaseForm): TERMINAL_ASSET_LIST_SORT_BY = forms.ChoiceField( choices=SORT_BY_CHOICES, initial='hostname', label=_("List sort by") ) - # TERMINAL_COMMAND_STORAGE = FormEncryptDictField( - # label=_("Command storage"), help_text=_( - # "Set terminal storage setting, `default` is the using as default," - # "You can set other storage and some terminal using" - # ) - # ) - # TERMINAL_REPLAY_STORAGE = FormEncryptDictField( - # label=_("Replay storage"), help_text=_( - # "Set replay storage setting, `default` is the using as default," - # "You can set other storage and some terminal using" - # ) - # ) class TerminalCommandStorage(BaseForm): diff --git a/apps/terminal/forms.py b/apps/terminal/forms.py index 55997a31b..893f15b12 100644 --- a/apps/terminal/forms.py +++ b/apps/terminal/forms.py @@ -10,21 +10,15 @@ from .models import Terminal def get_all_command_storage(): from common import utils command_storage = utils.get_command_storage_or_create_default_storage() - command_storage_choice = [] for k, v in command_storage.items(): - command_storage_choice.append((k, k)) - - return command_storage_choice + yield (k, k) def get_all_replay_storage(): from common import utils replay_storage = utils.get_replay_storage_or_create_default_storage() - replay_storage_choice = [] for k, v in replay_storage.items(): - replay_storage_choice.append((k, k)) - - return replay_storage_choice + yield (k, k) class TerminalForm(forms.ModelForm):