def get_theme_template_sources():
     """
     Return template sources for the given theme and if request object is None (this would be the case for
     management commands) return template sources for all themes.
     """
     if not get_current_request():
         # if request object is not present, then this method is being called inside a management
         # command and return all theme template sources for compression
         return get_all_theme_template_dirs()
     else:
         # template is being accessed by a view, so return templates sources for current theme
         theme = get_current_theme()
         return theme and theme.template_dirs
Beispiel #2
0
 def get_theme_template_sources():
     """
     Return template sources for the given theme and if request object is None (this would be the case for
     management commands) return template sources for all themes.
     """
     if not get_current_request():
         # if request object is not present, then this method is being called inside a management
         # command and return all theme template sources for compression
         return get_all_theme_template_dirs()
     else:
         # template is being accessed by a view, so return templates sources for current theme
         theme = get_current_theme()
         return theme and theme.template_dirs