Fix duplicates when mixing explicit and autogenerated ids #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When some metadata section ids, but not all, are autogenerated, duplicates can easily occur. This PR changes metsrw to track ids used, and if a conflicting id is generated, retry.
I'm not totally happy with this implementation, I think if we had a more consistent metadata class structure, we could easily do this in a base class, but it's an improvement on what was there.
I've also made
id_string
a property (vs a method) inbdf84b6, which is a small API change that will require updates to a few lines in Archivematica (all in archivematicaCreateMETSReingest.py). That change can be dropped if it is problematic, it just seemed like an easy improvement.
Connects to archivematica/Issues#442.