コード例 #1
0
ファイル: middleware.py プロジェクト: eduNEXT/eox-theming
    def process_request(self, request):
        """
        Set the request's 'site_theme'
        """
        # TODO: resolve. If the site does not exist, should we create it? or use a placeholder site_id

        theme_name = ThemingConfiguration.get_theme_name()

        if theme_name:
            current_theme = SITE_THEME(
                site_id=1,
                theme_dir_name=theme_name,
            )
            current_theme.id = 1
            request.site_theme = current_theme
コード例 #2
0
ファイル: patches.py プロジェクト: eduNEXT/eox-theming
 def is_current_theme(self):
     """
     Check if the theme instance is the current tenant theme
     """
     return self.name == ThemingConfiguration.get_theme_name()
コード例 #3
0
 def test_get_theme_name_tenant(self):
     """
     Test get_theme_name for microsite v0.
     """
     theme = ThemingConfiguration.get_theme_name()
     self.assertEqual(theme, 'other-theme')
コード例 #4
0
 def test_get_theme_name(self):
     """
     Test get_theme_name function.
     """
     theme = ThemingConfiguration.get_theme_name()
     self.assertEqual(theme, 'default-theme')