mirror of https://github.com/jumpserver/jumpserver
fix: 修复资产平台导入失败的问题(ID没有返回)
parent
1b0d23fbf4
commit
23361fdba9
|
@ -52,14 +52,15 @@ class BaseFileParser(BaseParser):
|
|||
fields_map = {}
|
||||
fields = self.serializer_fields
|
||||
for k, v in fields.items():
|
||||
if v.read_only:
|
||||
# 资产平台的 id 是只读的, 导入更新资产平台会失败
|
||||
if v.read_only and k not in ['id', 'pk']:
|
||||
continue
|
||||
fields_map.update({
|
||||
v.label: k,
|
||||
k: k
|
||||
})
|
||||
field_names = [
|
||||
fields_map.get(column_title.strip('*'), '')
|
||||
fields_map.get(column_title.strip('*').lower(), '')
|
||||
for column_title in column_titles
|
||||
]
|
||||
return field_names
|
||||
|
|
Loading…
Reference in New Issue