mirror of https://github.com/jumpserver/jumpserver
perf: 数据库应用database字段添加allow_null=True (#5196)
* perf: 数据库应用database字段修改为required * perf: 数据库应用database字段添加allow_null=True Co-authored-by: Bai <bugatti_it@163.com>pull/5200/head
parent
b189e363cc
commit
32dbab2e34
|
@ -12,9 +12,8 @@ from .. import models
|
|||
class DBAttrsSerializer(serializers.Serializer):
|
||||
host = serializers.CharField(max_length=128, label=_('Host'))
|
||||
port = serializers.IntegerField(label=_('Port'))
|
||||
database = serializers.CharField(
|
||||
max_length=128, required=False, allow_blank=True, allow_null=True, label=_('Database')
|
||||
)
|
||||
# 添加allow_null=True,兼容之前数据库中database字段为None的情况
|
||||
database = serializers.CharField(max_length=128, required=True, allow_null=True, label=_('Database'))
|
||||
|
||||
|
||||
class MySQLAttrsSerializer(DBAttrsSerializer):
|
||||
|
|
Loading…
Reference in New Issue