perf: 数据库资产 默认数据库 是必填项

pull/10432/head
Bai 2023-05-10 16:21:32 +08:00 committed by Jiangjie.Bai
parent ebb0e796ce
commit b98aa377b6
1 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
from django.utils.translation import ugettext_lazy as _
from rest_framework.serializers import ValidationError
from rest_framework import serializers
from assets.models import Database
from assets.serializers.gateway import GatewayWithAccountSecretSerializer
@ -9,6 +10,8 @@ __all__ = ['DatabaseSerializer', 'DatabaseWithGatewaySerializer']
class DatabaseSerializer(AssetSerializer):
db_name = serializers.CharField(max_length=1024, label=_('Default database'), required=True)
class Meta(AssetSerializer.Meta):
model = Database
extra_fields = [