Skip to content

Prevent reference before assignment error - #2981

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

Prevent reference before assignment error#2981
rtibbles merged 1 commit into
learningequality: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

@codecov

codecovBot commented Feb 22, 2021

Copy link
Copy Markdown

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 FilesCoverage Δ
contentcuration/contentcuration/decorators.py56.60% <50.00%> (-37.60%)⬇️
...ntentcuration/contentcuration/db/models/manager.py91.20% <90.98%> (-8.80%)⬇️
contentcuration/contentcuration/forms.py82.35% <94.04%> (+33.89%)⬆️
contentcuration/contentcuration/api.py92.06% <100.00%> (+1.43%)⬆️
...tentcuration/contentcuration/context_processors.py100.00% <100.00%> (ø)
...ontentcuration/contentcuration/db/advisory_lock.py100.00% <100.00%> (ø)
...tcuration/contentcuration/db/models/expressions.py93.33% <100.00%> (-6.67%)⬇️
...entcuration/contentcuration/db/models/functions.py100.00% <100.00%> (ø)
...ation/contentcuration/tests/test_rest_framework.py36.93% <0.00%> (-63.07%)⬇️
contentcuration/contentcuration/utils/format.py21.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
MemberAuthor

Holding off merging until #2976 has been merged.

@rtibbles
rtibbles merged commit 0319f70 into learningequality:hotfixesFeb 23, 2021
@rtibbles
rtibbles deleted the node_missing_fallback branch February 23, 2021 17:34
Sign up for freeto 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

@rtibbles@bjester