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 django.db import models
from rest_framework import serializers 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.validators import PhoneValidator
from common.sdk.sms import BACKENDS from common.sdk.sms import BACKENDS
@ -26,10 +26,9 @@ class SignTmplPairSerializer(serializers.Serializer):
class BaseSMSSettingSerializer(serializers.Serializer): class BaseSMSSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('SMS') PREFIX_TITLE = _('SMS')
SMS_TEST_PHONE = serializers.CharField( SMS_TEST_PHONE = PhoneField(
max_length=256, required=False, validators=[PhoneValidator(), ], validators=[PhoneValidator()], required=False, allow_blank=True, allow_null=True, label=_('Test phone')
allow_blank=True, label=_('Test phone')
) )
def to_representation(self, instance): def to_representation(self, instance):