-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parameter to signal that reorders senses #1461
Comments
Can we just assume we're not using any "shared" senses? Global-signbank/signbank/gloss_update.py Lines 196 to 198 in 372ef1b
I'm going to delete this check. There is also some code that follows that removes example sentences. (The API is only using NGT right now, so since UvA is not using the old style example sentences, I think it's safe to remove that code.) |
The code precludes code that adds the updated senses
See the pull request #1463. I rewrote the code that removes the original senses to follow a tree traversal pattern to make sure things were deleted properly. I also removed the gloss's Translation objects. I also removed code for shared senses (which we have not been using). This seems to have fixed the consistency problem that led to this issue. But basically I recoded to avoid the consistency error. The code does not use the GlossSense methods anymore. |
I created this issue because I don't know how to add a parameter to the signal that reorders the senses. That is needed to add context to whether or not it is needed. |
Do not reorder senses during API update of senses.
The code currently removes the original senses one by one before adding the replacement senses provided.
Global-signbank/signbank/gloss_update.py
Line 194 in 9582c3a
The reorder senses is causing the transaction to fail because of consistency problems because it fires between the deletions.
Make this parametric on whether this originates from the API.
Global-signbank/signbank/dictionary/models.py
Lines 2839 to 2841 in 9582c3a
@vanlummelhuizen @Woseseltops : THIS IS WHERE THE BUG IS IN API UPDATE SENSES
Global-signbank/signbank/dictionary/models.py
Lines 1273 to 1279 in 7b475fa
There is an integrity error for some gloss senses.
Hence the fix here #1463 which is a fix for #1360. Also check #1468.
Original code: "update" code should not iteratively remove senses, etc because the "entire" object tree needs to remain consistent.
The reorder senses code is being called "during" the deletion loop.
A solution would be to prevent the "reorder senses" signal from firing "in between" deleting the senses in the update. (Include a preface that it should not do this during the API routine.)
The text was updated successfully, but these errors were encountered: