mirror of https://github.com/jumpserver/jumpserver
[Update] 修改导入bug
parent
a315df29ca
commit
8fb0d6315d
|
@ -49,6 +49,9 @@ class BulkListSerializerMixin(object):
|
||||||
"""
|
"""
|
||||||
List of dicts of native values <- List of dicts of primitive datatypes.
|
List of dicts of native values <- List of dicts of primitive datatypes.
|
||||||
"""
|
"""
|
||||||
|
if not self.instance:
|
||||||
|
return super().to_internal_value(data)
|
||||||
|
|
||||||
if html.is_html_input(data):
|
if html.is_html_input(data):
|
||||||
data = html.parse_html_list(data)
|
data = html.parse_html_list(data)
|
||||||
|
|
||||||
|
@ -81,7 +84,7 @@ class BulkListSerializerMixin(object):
|
||||||
pk = item["pk"]
|
pk = item["pk"]
|
||||||
else:
|
else:
|
||||||
raise ValidationError("id or pk not in data")
|
raise ValidationError("id or pk not in data")
|
||||||
child = self.instance.get(id=pk)
|
child = self.instance.get(id=pk) if self.instance else None
|
||||||
self.child.instance = child
|
self.child.instance = child
|
||||||
self.child.initial_data = item
|
self.child.initial_data = item
|
||||||
# raw
|
# raw
|
||||||
|
|
Loading…
Reference in New Issue