Skip to content

Fix partial updating of completion criteria#3383

Merged
sairina merged 2 commits intolearningequality:unstablefrom
rtibbles:tests_tests_all_the_way_down
May 13, 2022
Merged

Fix partial updating of completion criteria#3383
sairina merged 2 commits intolearningequality:unstablefrom
rtibbles:tests_tests_all_the_way_down

Conversation

@rtibbles
Copy link
Copy Markdown
Member

Summary

Description of the change(s) you made

#3382 did a lot of good things, but failed to account for partial updates of completion criteria - as such, the validation happens prematurely, so that if a change is just made to the threshold, and not the model, validation will fail because threshold is missing from the update.

This defers validation until after the instance has been updated in memory, and runs validation then, before any save has happened, therefore triggering a validation error and preventing incorrect data from being saved.

Manual verification steps performed

  1. Wrote regression test.
  2. Saw that it failed.
  3. Made it pass.
  4. Rejoiced.

rtibbles added 2 commits May 12, 2022 17:04
Move validation of completion criteria to update method to run validation,
on the update version.
@sairina sairina merged commit c65eb08 into learningequality:unstable May 13, 2022
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.

2 participants