|
1 | 1 |
|
2 | 2 | # Add the lti store filter to the filter list, creating the configuration if it doesn't |
3 | 3 | # exist but updating it if it does exist. |
4 | | - |
5 | 4 | _filter_name = 'org.openedx.xblock.lti_consumer.configuration.listed.v1' |
| 5 | +_step_name = 'lti_store.pipelines.GetLtiConfigurations' |
6 | 6 |
|
7 | | -# Get or create the filter and pipeline list for the filter we care about |
8 | | -_filter_to_update = OPEN_EDX_FILTERS_CONFIG.get(_filter_name, {}) |
9 | | -_pipeline_list = _filter_to_update.get('pipeline', []) |
10 | | - |
11 | | -# Update the list to add our new filter. |
12 | | -_pipeline_list.append('lti_store.pipelines.GetLtiConfigurations') |
13 | | - |
14 | | -# Replace the existing setting with the updated version from the bottom up. |
15 | | -# We do this because we might have created the object via the gets above. In |
16 | | -# which case, the parent object would not have a reference to it. |
17 | | -_filter_to_update['pipeline'] = _pipeline_list |
18 | | -# Just override this, we don't care if it's there or not. |
19 | | -_filter_to_update['fail_silently'] = False |
20 | | -OPEN_EDX_FILTERS_CONFIG[_filter_name] = _filter_to_update |
| 7 | +try: |
| 8 | + not OPEN_EDX_FILTERS_CONFIG |
| 9 | +except NameError: # OPEN_EDX_FILTERS_CONFIG is not defined |
| 10 | + OPEN_EDX_FILTERS_CONFIG = {} |
21 | 11 |
|
| 12 | +if not OPEN_EDX_FILTERS_CONFIG.get(_filter_name): |
| 13 | + OPEN_EDX_FILTERS_CONFIG[_filter_name] = { |
| 14 | + "fail_silently": False, |
| 15 | + "pipeline": [], |
| 16 | + } |
| 17 | +OPEN_EDX_FILTERS_CONFIG[_filter_name]["pipeline"].append(_step_name) |
0 commit comments