Fix dict changing size problem in retry_decrypt_..

Also add a copy() method to models, and make them able
to not have a sync_id (in which case they won't send pyotherside
events).
This commit is contained in:
miruka
2020-03-15 16:18:32 -04:00
parent d00db2256d
commit adbe2d88ee
4 changed files with 28 additions and 16 deletions

View File

@@ -42,13 +42,14 @@ class ModelItem:
self.parent_model._sorted_data.sort()
new_index = self.parent_model._sorted_data.index(self)
ModelItemFieldChanged(
self.parent_model.sync_id,
old_index,
new_index,
name,
self.serialize_field(name),
)
if self.parent_model.sync_id:
ModelItemFieldChanged(
self.parent_model.sync_id,
old_index,
new_index,
name,
self.serialize_field(name),
)
def __delattr__(self, name: str) -> None: