Skip to content

Commit

Permalink
fix: email templates caching (#34409)
Browse files Browse the repository at this point in the history
Authored-by: Dima Alipov <[email protected]>
  • Loading branch information
DmytroAlipov authored Mar 22, 2024
1 parent 7aae617 commit e184181
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions openedx/core/djangoapps/theming/template_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ class ThemeFilesystemLoader(FilesystemLoader):
is_usable = True
_accepts_engine_in_init = True

def __init__(self, engine, dirs=None):
if not dirs:
self.dirs = engine.dirs
def get_dirs(self):
"""
Override get_dirs method.
Make the theme templates a priority, avoiding cashing templates for django ones.
"""
dirs = super().get_dirs()
theme_dirs = self.get_theme_template_sources()
if isinstance(theme_dirs, list):
self.dirs = theme_dirs + self.dirs
super().__init__(engine, self.dirs)
if theme_dirs:
dirs = theme_dirs + dirs
return dirs

@staticmethod
def get_theme_template_sources():
Expand Down

0 comments on commit e184181

Please sign in to comment.