fix: 修改slugfield校验问题

pull/9657/head
Bai 2 years ago committed by Jiangjie.Bai
parent 137d69a539
commit 1888597451

@ -1,5 +1,6 @@
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from django.core import validators
from assets.const.web import FillType
from common.serializers import WritableNestedModelSerializer
@ -86,6 +87,9 @@ class PlatformProtocolsSerializer(serializers.ModelSerializer):
class PlatformSerializer(WritableNestedModelSerializer):
name = serializers.CharField(
label=_("Name"), max_length=50, validators=[validators.validate_unicode_slug]
)
charset = LabeledChoiceField(
choices=Platform.CharsetChoices.choices, label=_("Charset")
)

Loading…
Cancel
Save