[BUG] update() raises a RevisionIdWasChanged
when expecting a DuplicateKeyError
#1057
Labels
RevisionIdWasChanged
when expecting a DuplicateKeyError
#1057
Describe the bug
When creating a
Document
with an unique indexed attribute, violating the uniqueness raise aRevisionIdWasChanged
instead of aDuplicateKeyError
.To Reproduce
Expected behavior
Raise the
DuplicateKeyError
instead of replacing it by aRevisionIdWasChanged
.Additional context
The bug comes from documents.py, line 739/740.
I feel like we could easily catch the error, ensure the
DuplicateKeyError
comes from a revision id issue, and either raise aRevisionIdWasChanged
or this error.Something like:
I can prepare a PR for this, I just feel like my solution is a bit hacky right now... Any ideas ?
The text was updated successfully, but these errors were encountered: