Skip to content

Commit 8027f90

Browse files
committed
temp: Also add the filter to the filters config.
1 parent dddacb5 commit 8027f90

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# Add the lti store filter to the filter list, creating the configuration if it doesn't
3+
# exist but updating it if it does exist.
4+
5+
_filter_name = 'org.openedx.xblock.lti_consumer.configuration.listed.v1'
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
21+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# Add the lti store filter to the filter list, creating the configuration if it doesn't
3+
# exist but updating it if it does exist.
4+
5+
_filter_name = 'org.openedx.xblock.lti_consumer.configuration.listed.v1'
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
21+

0 commit comments

Comments
 (0)