-
Notifications
You must be signed in to change notification settings - Fork 146
fix: update advanced module list not working #2189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}`
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2189 +/- ##
=========================================
Coverage ? 94.08%
=========================================
Files ? 1164
Lines ? 24481
Branches ? 5305
=========================================
Hits ? 23033
Misses ? 1380
Partials ? 68 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@jignaciopm @arbrandes can you please take a look? Why is this so complicated :p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bradenmacdonald It was wrong to remove that in PR#1581... This change is correct. When this PR is merged, I'll apply the backport in my PR #2087
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK then good with me. But... shouldn't we have some test that catches this error? I think the test is mocked at too high of level, so it didn't catch this. The test should only mock the raw HTTP response coming from the API and then assert on the raw API response send back to the server after the settings are edited, and that would ensure bugs like this don't happen.
Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}` Follow up to openedx#1581 Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
…rt) (#2087) * fix: advanced-settings api should not camel-case return value (#1581) * fix: update advanced module list not working (#2189) Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}` Follow up to #1581 --------- Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
…rt) (openedx#2087) * fix: advanced-settings api should not camel-case return value (openedx#1581) * fix: update advanced module list not working (openedx#2189) Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}` Follow up to openedx#1581 --------- Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
…rt) (openedx#2087) * fix: advanced-settings api should not camel-case return value (openedx#1581) * fix: update advanced module list not working (openedx#2189) Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}` Follow up to openedx#1581 --------- Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
Ticket: TNL-12010
Backend was expecting
{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}
but after this PR merged, it was receiving
{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}
It's better to send snake case settings from frontend instead of changing/fixing the function at backend here.
If we change line 262 from
val = model['value']
toval = model
, it will still fail on next lineif hasattr(block, key) and getattr(block, key) != val:
ashasattr(block, 'advancedModules')
is incorrect. It needsadvancedModules
as key.Before:

After:
