Skip to content

Commit

Permalink
Merge pull request #2166 from openedx/ENT-9167/add-isMobile-transformer
Browse files Browse the repository at this point in the history
feat: add is_mobile transformer for CSOD
  • Loading branch information
hamzawaleed01 authored Jul 8, 2024
2 parents 871ea70 + feffcc7 commit 1abf830
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Unreleased
----------
* nothing unreleased

[4.21.1]
---------
* feat: add is_mobile transorfmer for CSOD content metadata exporter

[4.21.0]
---------
* refactor: replace openai usage with xpert api
Expand Down
2 changes: 1 addition & 1 deletion enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Your project description goes here.
"""

__version__ = "4.21.0"
__version__ = "4.21.1"
8 changes: 8 additions & 0 deletions integrated_channels/cornerstone/exporters/content_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class CornerstoneContentMetadataExporter(ContentMetadataExporter):
'Partners': 'organizations',
'Languages': 'languages',
'Subjects': 'subjects',
'IsMobile': 'is_mobile'
}
SKIP_KEY_IF_NONE = True
MAX_PAYLOAD_COUNT = getattr(settings, "ENTERPRISE_CORNERSTONE_MAX_CONTENT_PAYLOAD_COUNT", 1000)
Expand Down Expand Up @@ -116,6 +117,13 @@ def transform_is_active(self, content_metadata_item):
break
return is_active

def transform_is_mobile(self, content_metadata_item): # pylint: disable=unused-argument
"""
Returns IsMobile to True for all courses.
"""
is_mobile = True
return is_mobile

def transform_modified(self, content_metadata_item):
"""
Return the modified datetime of closest course run`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_course_list(self):
keys = {key for item in response.data for key in item.keys()}
expected_keys = [
"ID", "URL", "IsActive", "LastModifiedUTC", "Title", "Description",
"Thumbnail", "Partners", "Languages", "Subjects",
"Thumbnail", "Partners", "Languages", "Subjects", "IsMobile"
]
for key in expected_keys:
self.assertIn(key, keys)
Expand Down

0 comments on commit 1abf830

Please sign in to comment.