Fix error preventing widget changes #11498
Merged
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.
Types of changes
Description of Change
Replaced
get_or_create
because it was taking widget_id as an argument. This worked well for newly created records, but if a record already existed and the widget was being changed to a different widget, this would create a second cardsxnodesxwidget record for the node.This change reintroduces #9858, however, that error was due in part to making two immediate calls to the CardView endpoint to update the card and permissions trees here. Throttling the second call by 50ms prevents the issue, however, a better long term solution would be to avoid the second call and find a better way of ensuring the trees stay in sync.
Issues Solved
Closes #10899
Checklist