mirror of https://github.com/jumpserver/jumpserver
fix: 使用type
parent
a664d0b752
commit
87ca9cb11d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue