Use next to get first record instead of index
This allows to use set with ModelStorage.save. issue6633 review40521002
This commit is contained in:
1 parent
6e92c8e3ba
commit
79fb0bcb7d
1 file changed
+4
-3
@@ -1457,9 +1457,10 @@ class ModelStorage(Model):
|
||||
save_values = {}
|
||||
to_create = []
|
||||
to_write = []
|
||||
transaction = records[0]._transaction
|
||||
user = records[0]._user
|
||||
context = records[0]._context
|
||||
first = next(iter(records))
|
||||
transaction = first._transaction
|
||||
user = first._user
|
||||
context = first._context
|
||||
for record in records:
|
||||
if (record._transaction != transaction
|
||||
or user != record._user
|
||||
|
||||
Reference in new issue
Block a user