mirror of https://github.com/jumpserver/jumpserver
perf: 优化批量更新会查询全部数据的问题
parent
4c4f544f0d
commit
d795867916
|
@ -71,7 +71,7 @@ class BulkListSerializerMixin(object):
|
|||
"""
|
||||
List of dicts of native values <- List of dicts of primitive datatypes.
|
||||
"""
|
||||
if not self.instance:
|
||||
if self.instance is None:
|
||||
return super().to_internal_value(data)
|
||||
|
||||
if html.is_html_input(data):
|
||||
|
@ -106,7 +106,7 @@ class BulkListSerializerMixin(object):
|
|||
pk = item["pk"]
|
||||
else:
|
||||
raise ValidationError("id or pk not in data")
|
||||
child = self.instance.get(id=pk) if self.instance else None
|
||||
child = self.instance.get(id=pk)
|
||||
self.child.instance = child
|
||||
self.child.initial_data = item
|
||||
# raw
|
||||
|
|
Loading…
Reference in New Issue