mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-19 01:30:28 +00:00
修复授权导入优化资产、用户、用户组、节点、系统用户id为空报错的情况
This commit is contained in:
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)):
|
||||
|
Reference in New Issue
Block a user