fix: 使用type

pull/9366/head
jiangweidong 2023-01-30 20:26:07 +08:00
parent a664d0b752
commit 87ca9cb11d
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class DatabaseSerializer(AssetSerializer):
def validate(self, attrs):
platform = attrs.get('platform')
if platform and getattr(platform, 'name') == 'MongoDB' \
if platform and getattr(platform, 'type') == 'mongodb' \
and not attrs.get('db_name'):
raise ValidationError({'db_name': _('This field is required.')})
return attrs