Skip to content

Commit

Permalink
fix: Replaced UsageKey with CourseKey for the course lookup (#2062)
Browse files Browse the repository at this point in the history
* fix: replaced UsageKey with CourseKey for the course lookup
  • Loading branch information
jszewczulak authored Oct 2, 2023
1 parent 9ca0a18 commit 9f105e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion openassessment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Initialization Information for Open Assessment Module
"""

__version__ = '5.5.1'
__version__ = '5.5.2'
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,14 @@ def test_is_flexible_peer_grading_on(self):

@patch('openassessment.workflow.workflow_batch_update_api.modulestore')
@patch('openassessment.workflow.workflow_batch_update_api.UsageKey.from_string')
def test_get_workflow_update_data(self, mocked_from_string, mocked_modulestore):
@patch('openassessment.workflow.workflow_batch_update_api.CourseKey.from_string')
def test_get_workflow_update_data(self,
mocked_usage_key_from_string,
mocked_course_key_from_string,
mocked_modulestore):
mocked_modulestore.return_value = MockModulestore()
mocked_from_string.side_effect = mock_from_string
mocked_usage_key_from_string.side_effect = mock_from_string
mocked_course_key_from_string.side_effect = mock_from_string

peer_workflows = self.get_peer_workflows()
wup = update_api.get_workflow_update_data(peer_workflows)
Expand Down
4 changes: 2 additions & 2 deletions openassessment/workflow/workflow_batch_update_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import datetime
from django.utils import timezone

from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.keys import UsageKey, CourseKey
from openassessment.runtime_imports.functions import modulestore
from openassessment.assessment.models import PeerWorkflow
from openassessment.workflow import api
Expand Down Expand Up @@ -315,7 +315,7 @@ def get_workflow_update_data(peer_workflows):
try:
if peer_workflow.course_id not in course_settings_cache:
# retrieve course block from DB
course_block_key = UsageKey.from_string(peer_workflow.course_id)
course_block_key = CourseKey.from_string(peer_workflow.course_id)
course_block = store.get_item(course_block_key)
# add course settings to temp cache
course_settings_cache[peer_workflow.course_id] = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edx-ora2",
"version": "5.5.0",
"version": "5.5.2",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "^6.1.1",
Expand Down

0 comments on commit 9f105e5

Please sign in to comment.