예제 #1
0
    def test_is_site_configuration_enabled(self):
        """
        Test that is_site_configuration_enabled returns True when configuration is enabled.
        """
        with with_site_configuration_context(configuration=test_config):
            assert configuration_helpers.is_site_configuration_enabled()

        # Test without a Site Configuration
        assert not configuration_helpers.is_site_configuration_enabled()
예제 #2
0
    def test_is_site_configuration_enabled(self):
        """
        Test that is_site_configuration_enabled returns True when configuration is enabled.
        """
        with with_site_configuration_context(configuration=test_config):
            self.assertTrue(configuration_helpers.is_site_configuration_enabled())

        # Test without a Site Configuration
        self.assertFalse(configuration_helpers.is_site_configuration_enabled())
예제 #3
0
def is_request_in_themed_site():
    """
    This is a proxy function to hide microsite_configuration behind comprehensive theming.
    """
    # We need to give priority to theming/site-configuration over microsites
    return configuration_helpers.is_site_configuration_enabled(
    ) or microsite.is_request_in_microsite()
예제 #4
0
def get_journals_root_url():
    """
    Return the base url used to display Journals
    """
    if journals_enabled():
        if configuration_helpers.is_site_configuration_enabled():
            return configuration_helpers.get_configuration_value(
                'JOURNALS_URL_ROOT', settings.JOURNALS_URL_ROOT)
        else:
            return settings.JOURNALS_URL_ROOT
    else:
        return None
예제 #5
0
파일: api.py 프로젝트: cmscom/edx-platform
def get_journals_root_url():
    """
    Return the base url used to display Journals
    """
    if journals_enabled():
        if configuration_helpers.is_site_configuration_enabled():
            return configuration_helpers.get_configuration_value(
                'JOURNALS_URL_ROOT',
                settings.JOURNALS_URL_ROOT
            )
        else:
            return settings.JOURNALS_URL_ROOT
    else:
        return None
예제 #6
0
def is_request_in_themed_site():
    """
    This is a proxy function to hide microsite_configuration behind comprehensive theming.
    """
    # We need to give priority to theming/site-configuration over microsites
    return configuration_helpers.is_site_configuration_enabled() or microsite.is_request_in_microsite()
예제 #7
0
def is_request_in_themed_site():
    """
    This is a proxy function to site_configuration.
    """
    return configuration_helpers.is_site_configuration_enabled()