Skip to content

Commit

Permalink
fix completion submission for old mongo keys (#81)
Browse files Browse the repository at this point in the history
msaqib52 authored Jan 14, 2021
1 parent c3b1c1a commit 7d71d0e
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion completion_aggregator/__init__.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@

from __future__ import absolute_import, unicode_literals

__version__ = '3.0.0'
__version__ = '3.0.1'

default_app_config = 'completion_aggregator.apps.CompletionAggregatorAppConfig' # pylint: disable=invalid-name
4 changes: 4 additions & 0 deletions completion_aggregator/api/v0/views.py
Original file line number Diff line number Diff line change
@@ -426,6 +426,10 @@ def post(self, request, course_key, block_key):
except (InvalidKeyError, compat.get_item_not_found_error()):
return Response(status=status.HTTP_404_NOT_FOUND)

if block_key.course_key.run is None:
# Old mongo keys must be annotated with course run info before calling submit_completion
block_key = block_key.replace(course_key=course_key)

_, created = BlockCompletion.objects.submit_completion(
user=request.user,
block_key=block_key,

0 comments on commit 7d71d0e

Please sign in to comment.