Skip to content
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

Stop throwing errors when grading policy is missing min_count key #78

Closed
pdpinch opened this issue Sep 9, 2015 · 0 comments
Closed
Assignees
Labels

Comments

@pdpinch
Copy link
Member

pdpinch commented Sep 9, 2015

From https://odl.zendesk.com/agent/tickets/2401

8.05 has a degenerate but otherwise working grading_policy:

https://github.mit.edu/mitx/content-mit-805x/blob/edgeccx/policies/1T2015/grading_policy.json#L17-L28

Two assignment types are missing the min_count key. When we try to save the CCX schedule, we check the min_count to see if we need to update it due to assignments being removed from the CCX. If the key doesn't exist, it results in a 500:

Traceback (most recent call last):

 File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 109, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
   response = view_func(request, *args, **kwargs)

 File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 75, in _cache_controlled
   response = viewfunc(request, *args, **kw)

 File "/edx/app/edxapp/edx-platform/lms/djangoapps/ccx/views.py", line 99, in wrapper
   return view(request, course, ccx)

 File "/edx/app/edxapp/edx-platform/lms/djangoapps/ccx/views.py", line 258, in save_ccx
   if count < section['min_count']:

KeyError: 'min_count'

We should protect against this. It's safe to assume that min_count = 0 when there is no value.

@pdpinch pdpinch added the CCX label Sep 9, 2015
@pdpinch pdpinch added the ready label Sep 20, 2015
@pdpinch pdpinch closed this as completed Oct 5, 2015
amir-qayyum-khan pushed a commit that referenced this issue Mar 24, 2016
Create the security fix #2 for the RC 2016-03-22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants