EDUCATOR-1029 | More defensive version of ZeroSubsectionGrade.problem_scores - #15701
Conversation
There was a problem hiding this comment.
If this is meant to guard against None, would if problem_score is not None: be better? Or do you also want to skip the next line if problem_score is zero?
There was a problem hiding this comment.
I don't disagree with the end result because it makes the case we're handling more explicit, but isn't problem_score going to end up as an object, not an integer, and thus truthy any time it isn't None?
There was a problem hiding this comment.
Good question! Objects can evaluate to False: https://docs.python.org/2/reference/datamodel.html#object.__nonzero__
c7a7b12 to
acb3f17
Compare
|
jenkins run all |
|
github is having problems displaying all the tests, so here are links to passing runs:
|
|
Thanks for the quick fix. Is this something that should go into Ginkgo? |
|
@nedbat this should probably go into Gingko, as should https://github.com/edx/edx-platform/pull/15627 . Apologies for forgetting to alert you to 15627 when I merged it. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production on Tuesday, August 01, 2017. |
|
I've cherry-picked this onto Ginkgo (along with #15627) |
|
EdX Release Notice: This PR has been deployed to the production environment. |
https://openedx.atlassian.net/browse/EDUCATOR-1029
Also added a unit test to surface the bug that this change fixes.
Reviewers
FYI
@nedbat