feat: 系统设置 - 短信服务 - 多平台配置测试手机号: 增加区号显示与修改功能

pull/10438/head
fangfang.dong 2023-06-05 18:57:34 +08:00 committed by Jiangjie.Bai
parent f0c0ba3653
commit a6d586efb4
1 changed files with 4 additions and 5 deletions

View File

@ -2,7 +2,7 @@ from django.utils.translation import ugettext_lazy as _
from django.db import models
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from common.serializers.fields import EncryptedField, PhoneField
from common.validators import PhoneValidator
from common.sdk.sms import BACKENDS
@ -27,9 +27,8 @@ class SignTmplPairSerializer(serializers.Serializer):
class BaseSMSSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('SMS')
SMS_TEST_PHONE = serializers.CharField(
max_length=256, required=False, validators=[PhoneValidator(), ],
allow_blank=True, label=_('Test phone')
SMS_TEST_PHONE = PhoneField(
validators=[PhoneValidator()], required=False, allow_blank=True, allow_null=True, label=_('Test phone')
)
def to_representation(self, instance):