Skip to content

Add license and title validation to views.internal::create_nodes - #2999

Merged
rtibbles merged 3 commits into
learningequality:developfrom
jonboiser:validate_new_nodes_title_and_license
Mar 12, 2021
Merged

Add license and title validation to views.internal::create_nodes#2999
rtibbles merged 3 commits into
learningequality:developfrom
jonboiser:validate_new_nodes_title_and_license

Conversation

@jonboiser

Copy link
Copy Markdown
Contributor

Summary

Description of the change(s) you made

  1. In views.internal::create_nodes, adds checks to validate the title and license. Sets the new node's complete field to false if the checks fail.
  2. Some code cleanup

Manual verification steps performed

(I'm not sure how to test this, since I think this API is only used via Sushi Chef)

Reviewer guidance

How can a reviewer test these changes?

  • Read the code carefully, does any of the new code do anything unsafe (e.g. commit a potential Key Error)

Are there any risky areas that deserve extra testing?

References

Partially addresses #2806, (does not invalidate nodes based on rest of criteria in mark_complete.py)

@jonboiser
jonboiser requested a review from rtibblesMarch 2, 2021 00:02
@jonboiser
jonboiserforce-pushed the validate_new_nodes_title_and_license branch from 79e6781 to e34cc2cCompareMarch 2, 2021 00:08
@codecov

codecovBot commented Mar 2, 2021

Copy link
Copy Markdown

Codecov Report

Merging #2999 (116ab82) into develop (67913e8) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@## develop #2999 +/- ##
===========================================
+ Coverage 85.74% 85.77% +0.02% 
===========================================
Files 298 298 Lines 15843 15876 +33 ===========================================
+ Hits 13585 13618 +33 
Misses 2258 2258 
Impacted FilesCoverage Δ
...contentcuration/tests/views/test_views_internal.py97.44% <100.00%> (+0.20%)⬆️
contentcuration/contentcuration/views/internal.py85.75% <100.00%> (+0.37%)⬆️

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 c6c7b8a...e34cc2c. Read the comment docs.

@rtibbles

Copy link
Copy Markdown
Member

Nice!

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.

2 participants

@jonboiser@rtibbles