diff --git a/Makefile b/Makefile index 3f164c5c26..dc1e70b51e 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ migrate: # 4) Remove the management command from this `deploy-migrate` recipe # 5) Repeat! deploy-migrate: - python contentcuration/manage.py fix_exercise_extra_fields + echo "Nothing to do here!" contentnodegc: python contentcuration/manage.py garbage_collect diff --git a/contentcuration/contentcuration/frontend/shared/leUtils/Languages.js b/contentcuration/contentcuration/frontend/shared/leUtils/Languages.js index 32365b7132..7c95090633 100644 --- a/contentcuration/contentcuration/frontend/shared/leUtils/Languages.js +++ b/contentcuration/contentcuration/frontend/shared/leUtils/Languages.js @@ -184,7 +184,7 @@ const LanguagesMap = new Map([ lang_subcode: null, readable_name: 'Brahui', native_name: 'Brahui', - lang_direction: 'ltr', + lang_direction: 'rtl', }, ], [ @@ -1130,7 +1130,7 @@ const LanguagesMap = new Map([ lang_subcode: null, readable_name: 'Northern Pashto', native_name: 'Northern Pashto', - lang_direction: 'ltr', + lang_direction: 'rtl', }, ], [ @@ -1471,7 +1471,7 @@ const LanguagesMap = new Map([ lang_subcode: null, readable_name: 'Southern Balochi', native_name: 'Southern Balochi', - lang_direction: 'ltr', + lang_direction: 'rtl', }, ], [ @@ -1626,7 +1626,7 @@ const LanguagesMap = new Map([ lang_subcode: null, readable_name: 'Uighur; Uyghur', native_name: 'Uy\u01a3urq\u0259, \u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5\u200e', - lang_direction: 'ltr', + lang_direction: 'rtl', }, ], [ @@ -2540,6 +2540,17 @@ const LanguagesMap = new Map([ lang_direction: 'rtl', }, ], + [ + 'prs', + { + id: 'prs', + lang_code: 'prs', + lang_subcode: null, + readable_name: 'Dari', + native_name: '\u062f\u0631\u06cc', + lang_direction: 'rtl', + }, + ], [ 'arq', { @@ -2604,7 +2615,7 @@ const LanguagesMap = new Map([ readable_name: 'Kashmiri', native_name: '\u0915\u0936\u094d\u092e\u0940\u0930\u0940, \u0643\u0634\u0645\u064a\u0631\u064a\u200e', - lang_direction: 'ltr', + lang_direction: 'rtl', }, ], [ @@ -2740,7 +2751,7 @@ const LanguagesMap = new Map([ readable_name: 'Sindhi', native_name: '\u0938\u093f\u0928\u094d\u0927\u0940, \u0633\u0646\u068c\u064a\u060c \u0633\u0646\u062f\u06be\u06cc\u200e', - lang_direction: 'ltr', + lang_direction: 'rtl', }, ], [ @@ -2784,7 +2795,7 @@ const LanguagesMap = new Map([ lang_subcode: null, readable_name: 'Punjabi', native_name: '\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40', - lang_direction: 'ltr', + lang_direction: 'rtl', }, ], [ @@ -3390,6 +3401,7 @@ export const LanguagesNames = { HE: 'he', UR: 'ur', AR: 'ar', + PRS: 'prs', ARQ: 'arq', FA: 'fa', PS: 'ps', diff --git a/contentcuration/contentcuration/frontend/shared/leUtils/MasteryModels.js b/contentcuration/contentcuration/frontend/shared/leUtils/MasteryModels.js index 57240f5c47..a909b5eefb 100644 --- a/contentcuration/contentcuration/frontend/shared/leUtils/MasteryModels.js +++ b/contentcuration/contentcuration/frontend/shared/leUtils/MasteryModels.js @@ -2,6 +2,7 @@ const MasteryModels = new Set([ 'do_all', 'm_of_n', + 'pre_post_test', 'num_correct_in_a_row_2', 'num_correct_in_a_row_3', 'num_correct_in_a_row_5', @@ -15,6 +16,7 @@ export const MasteryModelsList = Array.from(MasteryModels); export const MasteryModelsNames = { DO_ALL: 'do_all', M_OF_N: 'm_of_n', + PRE_POST_TEST: 'pre_post_test', NUM_CORRECT_IN_A_ROW_2: 'num_correct_in_a_row_2', NUM_CORRECT_IN_A_ROW_3: 'num_correct_in_a_row_3', NUM_CORRECT_IN_A_ROW_5: 'num_correct_in_a_row_5', diff --git a/contentcuration/contentcuration/tests/test_contentnodes.py b/contentcuration/contentcuration/tests/test_contentnodes.py index 0de23ab008..13b62fff17 100644 --- a/contentcuration/contentcuration/tests/test_contentnodes.py +++ b/contentcuration/contentcuration/tests/test_contentnodes.py @@ -824,6 +824,27 @@ def test_sync_after_no_changes(self): ) self._assert_same_files(orig_video, cloned_video) + def test_sync_but_incomplete(self): + orig_video, cloned_video = self._setup_original_and_deriative_nodes() + orig_video.license_id = None + orig_video.mark_complete() + self.assertFalse(orig_video.complete) + orig_video.save() + + self.assertTrue(cloned_video.complete) + + sync_node( + cloned_video, + sync_titles_and_descriptions=True, + sync_resource_details=True, + sync_files=True, + sync_assessment_items=True, + ) + + self.assertIsNotNone(cloned_video.license_id) + cloned_video.mark_complete() + self.assertTrue(cloned_video.complete) + def test_sync_with_subs(self): orig_video, cloned_video = self._setup_original_and_deriative_nodes() self._add_subs_to_video_node(orig_video, "fr") @@ -868,6 +889,13 @@ def _create_video_node(self, title, parent, withsubs=False): node_id="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ) video_node = testdata.node(data, parent=parent) + video_node.license_id = 9 # Special Permissions + video_node.license_description = "Special permissions for testing" + video_node.copyright_holder = "LE" + # ensure the node is complete according to our logic + video_node.mark_complete() + self.assertTrue(video_node.complete) + video_node.save() if withsubs: self._add_subs_to_video_node(video_node, "fr") diff --git a/contentcuration/contentcuration/utils/sync.py b/contentcuration/contentcuration/utils/sync.py index 2987d1c75b..6f175d9a4f 100644 --- a/contentcuration/contentcuration/utils/sync.py +++ b/contentcuration/contentcuration/utils/sync.py @@ -53,11 +53,14 @@ def sync_node( sync_assessment_items=False, ): original_node = node.get_original_node() + if not original_node.complete: + logging.warning( + f"Refusing to sync node {node.pk} from incomplete source node: {original_node.pk}" + ) + return node if original_node.node_id != node.node_id: # Only update if node is not original logging.info( - "----- Syncing: {} from {}".format( - node.title, original_node.get_channel().name - ) + f"----- Syncing: {node.title} from {original_node.get_channel().name}" ) if sync_titles_and_descriptions: fields = [ diff --git a/requirements.in b/requirements.in index c86a1d37c3..892f8c08be 100644 --- a/requirements.in +++ b/requirements.in @@ -5,7 +5,7 @@ djangorestframework==3.15.1 psycopg2-binary==2.9.10 django-js-reverse==0.10.2 django-registration==3.4 -le-utils==0.2.14 +le-utils==0.2.16 gunicorn==23.0.0 django-postmark==0.1.6 jsonfield==3.1.0 diff --git a/requirements.txt b/requirements.txt index 2e227661d1..e188c0f7a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -162,7 +162,7 @@ language-data==1.3.0 # via langcodes latex2mathml==3.78.0 # via -r requirements.in -le-utils==0.2.14 +le-utils==0.2.16 # via -r requirements.in marisa-trie==1.2.1 # via language-data