Merge pull request #1671 from pypeclub/bugfix/list_appending_fix

Settings list race condifiton and mutable dict list conversion
This commit is contained in:
Jakub Trllo 2021-06-09 19:58:08 +02:00 committed by GitHub
commit 3122ddfb2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -467,7 +467,7 @@ class DictMutableKeysEntity(EndpointEntity):
if self.store_as_list:
output = []
for key, child_entity in self.children_by_key.items():
output.append(key, child_entity.value)
output.append([key, child_entity.value])
return output
output = {}

View file

@ -100,7 +100,6 @@ class ListItem(QtWidgets.QWidget):
self.input_field = self.create_ui_for_entity(
self.category_widget, self.entity, self
)
self.input_field.set_entity_value()
spacer_widget = QtWidgets.QWidget(self)
spacer_widget.setAttribute(QtCore.Qt.WA_TranslucentBackground)
@ -337,6 +336,12 @@ class ListWidget(InputWidget):
self.content_layout.insertWidget(row + 1, item_widget)
self.input_fields.insert(row, item_widget)
# Change to entity value after item is added to `input_fields`
# - may cause recursion error as setting a value may cause input field
# change which will trigger this validation if entity is already
# added as widget here which won't because is not in input_fields
item_widget.input_field.set_entity_value()
if previous_field:
previous_field.order_changed()