Skip to content

Commit d5f242c

Browse files
committed
feat: add support for extra jinja filters
1 parent b47bc95 commit d5f242c

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

tutoraspects/patches/superset-jinja-filters

Whitespace-only changes.

tutoraspects/plugin.py

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
"es": {"flag": "es", "name": "Spanish"},
174174
},
175175
),
176+
("SUPERSET_EXTRA_JINJA_FILTERS", {}),
176177
######################
177178
# dbt Settings
178179
# For the most part you shouldn't have to touch these

tutoraspects/templates/aspects/apps/superset/pythonpath/openedx_jinja_filters.py

+2
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ def can_view_courses(username, field_name="course_id"):
3838
else:
3939
# If you're not course staff on any courses, you don't get to see any.
4040
return NO_COURSES
41+
42+
{{ patch("superset-jinja-filters") }}

tutoraspects/templates/aspects/apps/superset/pythonpath/superset_config_docker.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@
7676
}
7777

7878
# Add this custom template processor which returns the list of courses the current user can access
79-
from openedx_jinja_filters import can_view_courses
79+
from openedx_jinja_filters import *
8080

8181
JINJA_CONTEXT_ADDONS = {
8282
'can_view_courses': can_view_courses,
83+
{% for filter in SUPERSET_EXTRA_JINJA_FILTERS %}'{{ filter }}': {{filter}},{% endfor %}
8384
}
8485

8586
{% if not ENABLE_WEB_PROXY %}

0 commit comments

Comments
 (0)