修复授权导入优化资产、用户、用户组、节点、系统用户id为空报错的情况

pull/6117/head
fghbng@qq.com 4 years ago committed by Jiangjie.Bai
parent 45feb468be
commit 4382921c57

@ -83,6 +83,16 @@ class AssetPermissionSerializer(BulkOrgResourceModelSerializer):
return queryset
def to_internal_value(self, data):
if not data['assets']:
data['assets'] = []
if not data['system_users']:
data['system_users'] = []
if not data['users']:
data['users'] = []
if not data['user_groups']:
data['user_groups'] = []
if not data['nodes']:
data['nodes'] = []
# 系统用户是必填项
system_users_display = data.pop('system_users_display', '')
for i in range(len(system_users_display)):

Loading…
Cancel
Save