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-dockerfile-post-python-requirements b/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-dockerfile-post-python-requirements index 140db99..c11cccd 100644 --- a/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-dockerfile-post-python-requirements +++ b/plugins/tutor-contrib-ltistore/tutor_ltistore/patches/openedx-dockerfile-post-python-requirements @@ -1,2 +1,2 @@ RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \ - pip install git+https://github.com/feanil/openedx-ltistore.git@feanil/lti1p3_fixes + pip install {{ LTISTORE_PIP_INSTALL }} 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 - diff --git a/plugins/tutor-contrib-ltistore/tutor_ltistore/plugin.py b/plugins/tutor-contrib-ltistore/tutor_ltistore/plugin.py index e03147d..da27fe3 100644 --- a/plugins/tutor-contrib-ltistore/tutor_ltistore/plugin.py +++ b/plugins/tutor-contrib-ltistore/tutor_ltistore/plugin.py @@ -17,6 +17,12 @@ # Each new setting is a pair: (setting_name, default_value). # Prefix your setting names with 'LTISTORE_'. ("LTISTORE_VERSION", __version__), + # It's useful to change this to git sources during development + # so we're making this a config value you can change. + ( + "LTISTORE_PIP_INSTALL", + "git+https://github.com/feanil/openedx-ltistore.git@feanil/minimal_lti1p3_fixes", + ), ] )