diff --git a/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-cms-common-settings b/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-cms-common-settings deleted file mode 100644 index 4b4d7c7..0000000 --- a/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-cms-common-settings +++ /dev/null @@ -1,21 +0,0 @@ - -# Add the lti store filter to the filter list, creating the configuration if it doesn't -# exist but updating it if it does exist. - -_filter_name = 'org.openedx.xblock.lti_consumer.configuration.listed.v1' - -# Get or create the filter and pipeline list for the filter we care about -_filter_to_update = OPEN_EDX_FILTERS_CONFIG.get(_filter_name, {}) -_pipeline_list = _filter_to_update.get('pipeline', []) - -# Update the list to add our new filter. -_pipeline_list.append('lti_store.pipelines.GetLtiConfigurations') - -# Replace the existing setting with the updated version from the bottom up. -# We do this because we might have created the object via the gets above. In -# which case, the parent object would not have a reference to it. -_filter_to_update['pipeline'] = _pipeline_list -# Just override this, we don't care if it's there or not. -_filter_to_update['fail_silently'] = False -OPEN_EDX_FILTERS_CONFIG[_filter_name] = _filter_to_update - diff --git a/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-common-settings b/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-common-settings new file mode 100644 index 0000000..cd78592 --- /dev/null +++ b/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-common-settings @@ -0,0 +1,17 @@ + +# Add the lti store filter to the filter list, creating the configuration if it doesn't +# exist but updating it if it does exist. +_filter_name = 'org.openedx.xblock.lti_consumer.configuration.listed.v1' +_step_name = 'lti_store.pipelines.GetLtiConfigurations' + +try: + not OPEN_EDX_FILTERS_CONFIG +except NameError: # OPEN_EDX_FILTERS_CONFIG is not defined + OPEN_EDX_FILTERS_CONFIG = {} + +if not OPEN_EDX_FILTERS_CONFIG.get(_filter_name): + OPEN_EDX_FILTERS_CONFIG[_filter_name] = { + "fail_silently": False, + "pipeline": [], + } +OPEN_EDX_FILTERS_CONFIG[_filter_name]["pipeline"].append(_step_name) diff --git a/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-lms-common-settings b/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-lms-common-settings deleted file mode 100644 index 4b4d7c7..0000000 --- a/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-lms-common-settings +++ /dev/null @@ -1,21 +0,0 @@ - -# Add the lti store filter to the filter list, creating the configuration if it doesn't -# exist but updating it if it does exist. - -_filter_name = 'org.openedx.xblock.lti_consumer.configuration.listed.v1' - -# Get or create the filter and pipeline list for the filter we care about -_filter_to_update = OPEN_EDX_FILTERS_CONFIG.get(_filter_name, {}) -_pipeline_list = _filter_to_update.get('pipeline', []) - -# Update the list to add our new filter. -_pipeline_list.append('lti_store.pipelines.GetLtiConfigurations') - -# Replace the existing setting with the updated version from the bottom up. -# We do this because we might have created the object via the gets above. In -# which case, the parent object would not have a reference to it. -_filter_to_update['pipeline'] = _pipeline_list -# Just override this, we don't care if it's there or not. -_filter_to_update['fail_silently'] = False -OPEN_EDX_FILTERS_CONFIG[_filter_name] = _filter_to_update -