diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py index 4a8f4ce33dc0d07e226fd27b7ffd50c9e61f7c69..b6b4921932124bbe2f688bb96ca5588f4bbcaac3 100644 --- a/src/linkahead/common/models.py +++ b/src/linkahead/common/models.py @@ -3842,6 +3842,11 @@ class Container(list): # continue # except KeyError: # pass + + # we expect that every inserted entity produces + # exactly one entity in the server's response + sync_unique = True + for entity in self: if entity.is_valid(): continue @@ -3859,6 +3864,7 @@ class Container(list): entity_xml.set("upload", entity._upload) elif hasattr(entity, 'recursive_import') and entity.recursive_import is True: entity_xml.set("recursive_import", "true") + sync_unique=False elif hasattr(entity, 'import_file') and entity.import_file is True: entity_xml.set("import", "true") insert_xml.append(entity_xml) @@ -3893,7 +3899,7 @@ class Container(list): if sync: - self._sync(cresp, unique=unique, + self._sync(cresp, unique=sync_unique, raise_exception_on_error=raise_exception_on_error) if raise_exception_on_error: