Skip to content

Prevent reference before assignment error#2981

Merged
rtibbles merged 1 commit intolearningequality:hotfixesfrom
rtibbles:node_missing_fallback
Feb 23, 2021
Merged

Prevent reference before assignment error#2981
rtibbles merged 1 commit intolearningequality:hotfixesfrom
rtibbles:node_missing_fallback

Conversation

@rtibbles
Copy link
Copy Markdown
Member

Description

  • If a node with the specified id already exists in the backend when we try to duplicate, this can lead to an IntegrityError
  • We then fail to have a referent for passing the change back to the frontend
  • This case likely happens when a copy change is sent to the backend twice

Issue Addressed (if applicable)

Fixes #2904

@rtibbles rtibbles added this to the Post Release Stabilization milestone Feb 22, 2021
@rtibbles rtibbles requested a review from bjester February 22, 2021 19:30
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 22, 2021

Codecov Report

Merging #2981 (435f144) into hotfixes (28587f8) will increase coverage by 4.94%.
The diff coverage is 92.92%.

Impacted file tree graph

@@             Coverage Diff              @@
##           hotfixes    #2981      +/-   ##
============================================
+ Coverage     80.80%   85.74%   +4.94%     
============================================
  Files           281      298      +17     
  Lines         12659    15845    +3186     
============================================
+ Hits          10229    13587    +3358     
+ Misses         2430     2258     -172     
Impacted Files Coverage Δ
contentcuration/contentcuration/decorators.py 56.60% <50.00%> (-37.60%) ⬇️
...ntentcuration/contentcuration/db/models/manager.py 91.20% <90.98%> (-8.80%) ⬇️
contentcuration/contentcuration/forms.py 82.35% <94.04%> (+33.89%) ⬆️
contentcuration/contentcuration/api.py 92.06% <100.00%> (+1.43%) ⬆️
...tentcuration/contentcuration/context_processors.py 100.00% <100.00%> (ø)
...ontentcuration/contentcuration/db/advisory_lock.py 100.00% <100.00%> (ø)
...tcuration/contentcuration/db/models/expressions.py 93.33% <100.00%> (-6.67%) ⬇️
...entcuration/contentcuration/db/models/functions.py 100.00% <100.00%> (ø)
...ation/contentcuration/tests/test_rest_framework.py 36.93% <0.00%> (-63.07%) ⬇️
contentcuration/contentcuration/utils/format.py 21.05% <0.00%> (-49.54%) ⬇️
... and 181 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7e1b5a...435f144. Read the comment docs.

@rtibbles
Copy link
Copy Markdown
Member Author

Holding off merging until #2976 has been merged.

@rtibbles rtibbles merged commit 0319f70 into learningequality:hotfixes Feb 23, 2021
@rtibbles rtibbles deleted the node_missing_fallback branch February 23, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When duplication fails, the change update ends up referencing a non-existent variable

2 participants