perf: 优化短信 (#6826)

* perf: 优化短信

* refactor: 适配新的短信模板配置

Co-authored-by: ibuler <ibuler@qq.com>
Co-authored-by: xinwen <coderWen@126.com>
This commit is contained in:
fit2bot
2021-09-13 20:15:59 +08:00
committed by GitHub
parent 55a5dd1e34
commit 7a45f4d129
12 changed files with 58 additions and 81 deletions

View File

@@ -1,5 +1,3 @@
from abc import ABCMeta
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
@@ -17,8 +15,12 @@ class OtherSettingSerializer(serializers.Serializer):
OTP_VALID_WINDOW = serializers.IntegerField(label=_("OTP valid window"))
PERIOD_TASK_ENABLED = serializers.BooleanField(required=False, label=_("Enable period task"))
WINDOWS_SSH_DEFAULT_SHELL = serializers.CharField(
required=False, max_length=1024, label=_('Ansible windows default shell'),
WINDOWS_SSH_DEFAULT_SHELL = serializers.ChoiceField(
choices=[
('cmd', _("CMD")),
('powershell', _("PowerShell"))
],
label=_('Ansible windows default shell'),
help_text=_('The shell type used when Windows assets perform ansible tasks')
)