Esempio n. 1
0
 def test_name_validation(self):
     WaffleSwitch(  # lint-amnesty, pylint: disable=toggle-missing-annotation
         "namespaced.name", module_name="module1"
     )
     with self.assertRaises(ValueError):
         WaffleSwitch(  # lint-amnesty, pylint: disable=toggle-missing-annotation
             "non_namespaced", module_name="module1"
         )
Esempio n. 2
0
    def test_override(self):
        switch = WaffleSwitch("test_namespace.test_switch",
                              module_name="testmodule")

        self.assertFalse(switch.is_enabled())
        with override_waffle_switch(switch, active=True):
            self.assertTrue(switch.is_enabled())
        self.assertFalse(switch.is_enabled())
Esempio n. 3
0
    def test_override(self):
        switch = WaffleSwitch(  # lint-amnesty, pylint: disable=toggle-missing-annotation
            "test_namespace.test_switch", module_name="testmodule"
        )

        self.assertFalse(switch.is_enabled())
        with override_waffle_switch(switch, active=True):
            self.assertTrue(switch.is_enabled())
        self.assertFalse(switch.is_enabled())
Esempio n. 4
0
def configure_waffle_namespace(feature_enabled):
    namespace = certs_waffle.waffle()
    auto_certificate_generation_switch = WaffleSwitch(
        namespace, certs_waffle.AUTO_CERTIFICATE_GENERATION)
    with override_waffle_switch(auto_certificate_generation_switch,
                                active=feature_enabled):
        yield
Esempio n. 5
0
 def _waffle_switch(switch_name):
     """
     Returns a ``WaffleSwitch`` object in WAFFLE_NAMESPACE
     with the given ``switch_name``.
     """
     # pylint: disable=toggle-missing-annotation
     return WaffleSwitch(f"{WAFFLE_NAMESPACE}.{switch_name}", module_name=__name__)
Esempio n. 6
0
 def _waffle_switch(switch_name):
     """
     Returns a ``WaffleSwitch`` object in WAFFLE_NAMESPACE
     with the given ``switch_name``.
     """
     # pylint: disable=feature-toggle-needs-doc
     return WaffleSwitch(f"{WAFFLE_NAMESPACE}.{switch_name}",
                         module_name=__name__)
Esempio n. 7
0
def waffle_switch(name):
    """
    Return the waffle switch associated to this namespace.

    WARNING: do not replicate this pattern. Instead of declaring waffle switch names as strings, you should create
    WaffleSwitch objects as top-level constants.
    """
    return WaffleSwitch(waffle(), name, module_name=__name__)
Esempio n. 8
0
def _add_waffle_switch_instances(switches_dict):
    """
    Add details from waffle switch instances, like code_owner.
    """
    waffle_switch_instances = WaffleSwitch.get_instances()
    for switch_instance in waffle_switch_instances:
        switch = get_or_create_toggle_response(switches_dict,
                                               switch_instance.name)
        _add_toggle_instance_details(switch, switch_instance)
Esempio n. 9
0
from lms.djangoapps.experiments.flags import ExperimentWaffleFlag
from lms.djangoapps.experiments.models import ExperimentData

WAFFLE_NAMESPACE = 'schedules'

# .. toggle_name: schedules.enable_debugging
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Enable debug level of logging for schedules messages.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2017-09-17
DEBUG_MESSAGE_WAFFLE_FLAG = WaffleFlag(f'{WAFFLE_NAMESPACE}.enable_debugging', __name__)

COURSE_UPDATE_SHOW_UNSUBSCRIBE_WAFFLE_SWITCH = WaffleSwitch(  # lint-amnesty, pylint: disable=toggle-missing-annotation
    f'{WAFFLE_NAMESPACE}.course_update_show_unsubscribe', __name__
)

# This experiment waffle is supporting an A/B test we are running on sending course updates from an external service,
# rather than through platform and ACE. See ticket AA-661 for more information.
# Don't use this flag directly, instead use the `set_up_external_updates_for_enrollment` and `query_external_updates`
# methods below. We save this flag decision at enrollment time and don't change it even if the flag changes. So you
# can't just directly look at flag result.
_EXTERNAL_COURSE_UPDATES_EXPERIMENT_ID = 18
_EXTERNAL_COURSE_UPDATES_FLAG = ExperimentWaffleFlag(  # lint-amnesty, pylint: disable=toggle-missing-annotation
    f'{WAFFLE_NAMESPACE}.external_updates', __name__,
    experiment_id=_EXTERNAL_COURSE_UPDATES_EXPERIMENT_ID,
    use_course_aware_bucketing=False
)

# Switches
# .. toggle_name: block_structure.invalidate_cache_on_publish
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: When enabled, the block structure cache is invalidated when changes to
#   courses are published. If `block_structure.storage_backing_for_cache` is active, all block
#   structures related to the published course are also cleared from storage.
# .. toggle_warnings: This switch will likely be deprecated and removed.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2017-02-23
# .. toggle_target_removal_date: 2017-05-23
# .. toggle_tickets: https://github.com/edx/edx-platform/pull/14358,
#   https://github.com/edx/edx-platform/pull/14571,
#   https://openedx.atlassian.net/browse/DEPR-144
INVALIDATE_CACHE_ON_PUBLISH = WaffleSwitch(
    "block_structure.invalidate_cache_on_publish", __name__)

# .. toggle_name: block_structure.storage_backing_for_cache
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: When enabled, block structures are stored in a more permanent storage,
#   like a database, which provides an additional backup for cache misses, instead having them
#   regenerated. The regenration of block structures is a time consuming process. Therefore,
#   enabling this switch is recommended for Production.
# .. toggle_warnings: Depends on `BLOCK_STRUCTURES_SETTINGS['STORAGE_CLASS']` and
#   `BLOCK_STRUCTURES_SETTINGS['STORAGE_KWARGS']`.
#   This switch will likely be deprecated and removed.
#   The annotation will be updated with the DEPR ticket once that process has started.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2017-02-23
# .. toggle_target_removal_date: 2017-05-23
Esempio n. 11
0
WAFFLE_NAMESPACE = 'grades'
LOG_PREFIX = 'Grades: '

# Switches

# .. toggle_name: grades.assume_zero_grade_if_absent
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: When enabled, an absent grade is assumed to be zero. Alternatively, defining the
#   `settings.FEATURES["ASSUME_ZERO_GRADE_IF_ABSENT_FOR_ALL_TESTS"]` feature flag in the LMS will enable this feature
#   for all courses.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2017-04-11
# .. toggle_tickets: https://github.com/edx/edx-platform/pull/14771
# .. toggle_warnings: This requires the PersistentGradesEnabledFlag to be enabled.
ASSUME_ZERO_GRADE_IF_ABSENT = WaffleSwitch(
    f'{WAFFLE_NAMESPACE}.assume_zero_grade_if_absent', __name__)
# .. toggle_name: grades.disable_regrade_on_policy_change
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: When enabled, a change in grading policy will not trigger re-grading.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2017-08-03
# .. toggle_tickets: https://github.com/edx/edx-platform/pull/15733
DISABLE_REGRADE_ON_POLICY_CHANGE = WaffleSwitch(
    f'{WAFFLE_NAMESPACE}.disable_regrade_on_policy_change', __name__)

# Course Flags

# .. toggle_name: grades.rejected_exam_overrides_grade
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
Esempio n. 12
0
    UserTestGroup)
from common.djangoapps.student.roles import REGISTERED_ACCESS_ROLES
from xmodule.modulestore.django import modulestore

User = get_user_model()  # pylint:disable=invalid-name

# .. toggle_name: student.courseenrollment_admin
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: This toggle will enable the rendering of the admin view of the CourseEnrollment model.
# .. toggle_warnings: Enabling this toggle may cause performance problems. The CourseEnrollment admin view
#     makes DB queries that could cause site outages for a large enough Open edX installation.
# .. toggle_use_cases: opt_in, open_edx
# .. toggle_creation_date: 2018-08-01
# .. toggle_tickets: https://github.com/edx/edx-platform/pull/18638
COURSE_ENROLLMENT_ADMIN_SWITCH = WaffleSwitch('student.courseenrollment_admin',
                                              __name__)


class _Check(object):
    """
    A method decorator that pre-emptively returns false if a feature is disabled.
    Otherwise, it returns the return value of the decorated method.

    To use, add this decorator above a method and pass in a function that returns
    a boolean indicating whether the feature is enabled.

    Example:
    @_Check.is_enabled(FEATURE_TOGGLE.is_enabled)
    """
    @classmethod
    def is_enabled(cls, is_enabled_func):
"""
Waffle flags and switches
"""

from edx_toggles.toggles import WaffleSwitch

# .. toggle_name: open_edx_util.display_maintenance_warning
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Displays the maintenance warning, when active.
# .. toggle_use_cases: opt_in
# .. toggle_creation_date: 2018-03-20
# .. toggle_tickets: https://github.com/edx/edx-platform/pull/17735
DISPLAY_MAINTENANCE_WARNING = WaffleSwitch(
    'open_edx_util.display_maintenance_warning', __name__)
Esempio n. 14
0
# .. toggle_name: COURSES_INVITE_ONLY
# .. toggle_implementation: SettingToggle
# .. toggle_type: feature_flag
# .. toggle_default: False
# .. toggle_description: Setting this sets the default value of INVITE_ONLY across all courses in a given deployment
# .. toggle_category: admin
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2019-05-16
# .. toggle_expiration_date: None
# .. toggle_tickets: https://github.com/mitodl/edx-platform/issues/123
# .. toggle_status: unsupported
COURSES_INVITE_ONLY = SettingToggle('COURSES_INVITE_ONLY', default=False)

ENABLE_OPTIMIZELY_IN_COURSEWARE = WaffleSwitch(  # lint-amnesty, pylint: disable=toggle-missing-annotation
    'RET.enable_optimizely_in_courseware', __name__
)


def courseware_mfe_is_active() -> bool:
    """
    Should we serve the Learning MFE as the canonical courseware experience?
    """
    from lms.djangoapps.courseware.access_utils import in_preview_mode  # avoid a circular import

    # We only use legacy views for the Studio "preview mode" feature these days, while everyone else gets the MFE
    return not in_preview_mode()


def course_exit_page_is_active(course_key):
    return (
Esempio n. 15
0
from edx_django_utils.monitoring import set_custom_attribute
from edx_toggles.toggles import WaffleSwitch

from openedx.core.lib.mobile_utils import is_request_from_mobile_app

# .. toggle_name: safe_session.log_request_user_changes
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Turn this toggle on to log anytime the `user` attribute of the request object gets
#   changed.  This will also log the location where the change is coming from to quickly find issues.
# .. toggle_warnings: This logging will be very verbose and so should probably not be left on all the time.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2021-03-25
# .. toggle_target_removal_date: 2021-05-01
# .. toggle_tickets: https://openedx.atlassian.net/browse/ARCHBOM-1718
LOG_REQUEST_USER_CHANGES_FLAG = WaffleSwitch('safe_session.log_request_user_changes', __name__)

log = getLogger(__name__)


class SafeCookieError(Exception):
    """
    An exception class for safe cookie related errors.
    """
    def __init__(self, error_message):
        super().__init__(error_message)
        log.error(error_message)


@python_2_unicode_compatible
class SafeCookieData:
Esempio n. 16
0
    "ol",
    "p",
    "span",
    "strong",
    "ul",
]

# .. toggle_name: USE_CERTIFICATE_AVAILABLE_DATE
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Toggle to control use of the certificate_available_date
#   field during development.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2021-04-30
# .. toggle_target_removal_date: 2021-06-01
# .. toggle_tickets: https://openedx.atlassian.net/browse/MICROBA-1169, https://openedx.atlassian.net/browse/MICROBA-1198 (ticket for removal)
USE_CERTIFICATE_AVAILABLE_DATE = WaffleSwitch(
    "credentials.use_certificate_available_date", module_name=__name__)

LOGO_TRADEMARK_URL = "https://edx-cdn.org/v3/default/logo-trademark.svg"
LOGO_TRADEMARK_URL_PNG = "https://edx-cdn.org/v3/default/logo-trademark.png"
LOGO_TRADEMARK_URL_SVG = "https://edx-cdn.org/v3/default/logo-trademark.svg"
LOGO_URL = "https://edx-cdn.org/v3/default/logo.svg"
LOGO_URL_PNG = "https://edx-cdn.org/v3/default/logo.png"
LOGO_URL_SVG = "https://edx-cdn.org/v3/default/logo.svg"
LOGO_WHITE_URL = "https://edx-cdn.org/v3/default/logo-white.svg"
LOGO_WHITE_URL_PNG = "https://edx-cdn.org/v3/default/logo-white.png"
LOGO_WHITE_URL_SVG = "https://edx-cdn.org/v3/default/logo-white.svg"
FAVICON_URL = "https://edx-cdn.org/v3/default/favicon.ico"
LOGO_POWERED_BY_OPEN_EDX_URL = "https://edx-cdn.org/v3/prod/open-edx-tag.svg"
Esempio n. 17
0
"""
Toggles for blockstore.
"""

from edx_toggles.toggles import WaffleSwitch

# .. toggle_name: blockstore.use_blockstore_app_api
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Enable to use the installed blockstore app's Python API directly instead of the
#   external blockstore service REST API.
#   The blockstore REST API is used by default.
# .. toggle_use_cases: temporary, open_edx
# .. toggle_creation_date: 2022-01-13
# .. toggle_target_removal_date: None
# .. toggle_tickets: TNL-8705, BD-14
# .. toggle_warnings: This temporary feature toggle does not have a target removal date.
BLOCKSTORE_USE_BLOCKSTORE_APP_API = WaffleSwitch(
    'blockstore.use_blockstore_app_api', __name__)
Esempio n. 18
0
from edx_toggles.toggles.testutils import override_waffle_switch
from student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory

from lms.djangoapps.certificates import api as certs_api
from lms.djangoapps.certificates.models import (
    CertificateGenerationConfiguration, CertificateStatuses,
    CertificateWhitelist, GeneratedCertificate)
from lms.djangoapps.certificates.signals import CERTIFICATE_DELAY_SECONDS, fire_ungenerated_certificate_task
from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory
from lms.djangoapps.grades.tests.utils import mock_passing_grade
from lms.djangoapps.verify_student.models import IDVerificationAttempt, SoftwareSecurePhotoVerification
from openedx.core.djangoapps.certificates.config import waffle

AUTO_CERTIFICATE_GENERATION_SWITCH = WaffleSwitch(
    waffle.waffle(), waffle.AUTO_CERTIFICATE_GENERATION)


class SelfGeneratedCertsSignalTest(ModuleStoreTestCase):
    """
    Tests for enabling/disabling self-generated certificates according to course-pacing.
    """
    ENABLED_SIGNALS = ['course_published']

    def setUp(self):
        super(SelfGeneratedCertsSignalTest, self).setUp()
        CertificateGenerationConfiguration.objects.create(enabled=True)

    def test_cert_generation_flag_on_pacing_toggle(self):
        """
        Verify that signal enables or disables self-generated certificates
Esempio n. 19
0
"""
Waffle flags and switches for third party auth .
"""

from edx_toggles.toggles import WaffleSwitch

WAFFLE_NAMESPACE = 'third_party_auth'

# .. toggle_name: third_party_auth.enable_multiple_sso_accounts_association_to_saml_user
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: If enabled than learner should not be prompted for their edX password arriving via SAML
#   and already linked to the enterprise customer linked to the same IdP."
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2021-01-29
# .. toggle_target_removal_date: 2021-04-31
# .. toggle_tickets: ENT-4034
ENABLE_MULTIPLE_SSO_ACCOUNTS_ASSOCIATION_TO_SAML_USER = WaffleSwitch(
    f'{WAFFLE_NAMESPACE}.enable_multiple_sso_accounts_association_to_saml_user',
    __name__)
Esempio n. 20
0
"""
Platform support for Programs.

This package is a thin wrapper around interactions with the Programs service,
supporting learner- and author-facing features involving that service
if and only if the service is deployed in the Open edX installation.

To ensure maximum separation of concerns, and a minimum of interdependencies,
this package should be kept small, thin, and stateless.
"""
from edx_toggles.toggles import WaffleSwitch

default_app_config = 'openedx.core.djangoapps.programs.apps.ProgramsConfig'

PROGRAMS_WAFFLE_SWITCH_NAMESPACE = 'programs'

# This is meant to be enabled until https://openedx.atlassian.net/browse/LEARNER-5573 needs to be resolved
ALWAYS_CALCULATE_PROGRAM_PRICE_AS_ANONYMOUS_USER = WaffleSwitch(  # lint-amnesty, pylint: disable=toggle-missing-annotation
    f'{PROGRAMS_WAFFLE_SWITCH_NAMESPACE}.always_calculate_program_price_as_anonymous_user',
    __name__)
Esempio n. 21
0
"""
This module contains various configuration settings via
waffle switches for the catalog app.
"""

from edx_toggles.toggles import WaffleSwitch

WAFFLE_NAMESPACE = 'catalog'
DISABLE_MODEL_ADMIN_CHANGES = 'disable_model_admin_changes'
# .. toggle_name: catalog.disable_model_admin_changes
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Indicates whether or not to disable Django admin changes for configured models.
# .. toggle_use_cases: opt_in
# .. toggle_creation_date: 2021-03-25
DISABLE_MODEL_ADMIN_CHANGES_SWITCH = WaffleSwitch(
    f'{WAFFLE_NAMESPACE}.{DISABLE_MODEL_ADMIN_CHANGES}',
    module_name=__name__,
)
Esempio n. 22
0
"""

from edx_toggles.toggles import WaffleSwitch, WaffleSwitchNamespace

# Namespace
WAFFLE_NAMESPACE = "completion"


def waffle():
    """
    Returns the namespaced, cached, audited Waffle class for completion.
    """
    return WaffleSwitchNamespace(name=WAFFLE_NAMESPACE,
                                 log_prefix="completion: ")


# Switches

# The switch name variable is preserved for backward compatibility
ENABLE_COMPLETION_TRACKING = "enable_completion_tracking"
# .. toggle_name: completion.enable_completion_tracking
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Indicates whether or not to track completion of individual blocks. Keeping this disabled
#   will prevent creation of BlockCompletion objects in the database, as well as preventing completion-related
#   network access by certain xblocks.
# .. toggle_use_cases: open_edx
ENABLE_COMPLETION_TRACKING_SWITCH = WaffleSwitch(waffle(),
                                                 ENABLE_COMPLETION_TRACKING,
                                                 module_name=__name__)
Esempio n. 23
0
    BulkChangeEnrollmentConfiguration, BulkUnenrollConfiguration,
    CourseAccessRole, CourseEnrollment, CourseEnrollmentAllowed,
    CourseEnrollmentCelebration, DashboardConfiguration,
    LinkedInAddToProfileConfiguration, LoginFailures, PendingNameChange,
    Registration, RegistrationCookieConfiguration, UserAttribute, UserProfile,
    UserTestGroup)
from student.roles import REGISTERED_ACCESS_ROLES
from xmodule.modulestore.django import modulestore

User = get_user_model()  # pylint:disable=invalid-name

# This switch exists because the CourseEnrollment admin views make DB queries that impact performance.
# In a large enough deployment of Open edX, this is enough to cause a site outage.
# See https://openedx.atlassian.net/browse/OPS-2943
COURSE_ENROLLMENT_ADMIN_SWITCH = WaffleSwitch(STUDENT_WAFFLE_NAMESPACE,
                                              'courseenrollment_admin',
                                              __name__)


class _Check(object):
    """
    A method decorator that pre-emptively returns false if a feature is disabled.
    Otherwise, it returns the return value of the decorated method.

    To use, add this decorator above a method and pass in a function that returns
    a boolean indicating whether the feature is enabled.

    Example:
    @_Check.is_enabled(FEATURE_TOGGLE.is_enabled)
    """
    @classmethod
Esempio n. 24
0
""" Course API """

from edx_toggles.toggles import WaffleSwitch

WAFFLE_SWITCH_NAMESPACE = 'course_list_api_rate_limit'

# .. toggle_name: course_list_api_rate_limit.rate_limit_2
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Waffle switch to enable the throttling of 2 requests/minute to the course API. For staff
#   users, this limit is 10 requests/minute.
# .. toggle_use_cases: circuit_breaker
# .. toggle_creation_date: 2018-06-12
# .. toggle_tickets: https://openedx.atlassian.net/browse/LEARNER-5527
USE_RATE_LIMIT_2_FOR_COURSE_LIST_API = WaffleSwitch(
    f'{WAFFLE_SWITCH_NAMESPACE}.rate_limit_2', __name__)
# .. toggle_name: course_list_api_rate_limit.rate_limit_10
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Waffle switch to enable the throttling of 10 requests/minute to the course API. For staff
#   users, this limit is 20 requests/minute.
# .. toggle_use_cases: circuit_breaker
# .. toggle_creation_date: 2018-06-12
# .. toggle_tickets: https://openedx.atlassian.net/browse/LEARNER-5527
USE_RATE_LIMIT_10_FOR_COURSE_LIST_API = WaffleSwitch(
    f'{WAFFLE_SWITCH_NAMESPACE}.rate_limit_10', __name__)
Esempio n. 25
0
Waffle flags and switches for user authn.
"""

from edx_toggles.toggles import WaffleSwitch

_WAFFLE_NAMESPACE = 'user_authn'

# .. toggle_name: user_authn.enable_login_using_thirdparty_auth_only
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: When enabled, users must be sign in using their allowed domain SSO account. This includes sign-
#   ins to the Django admin dashboard at "/admin".
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2019-11-20
# .. toggle_target_removal_date: 2020-01-31
# .. toggle_warnings: Requires THIRD_PARTY_AUTH_ONLY_DOMAIN to also be set.
# .. toggle_tickets: ENT-2461
ENABLE_LOGIN_USING_THIRDPARTY_AUTH_ONLY = WaffleSwitch(
    f'{_WAFFLE_NAMESPACE}.enable_login_using_thirdparty_auth_only', __name__)

# .. toggle_name: user_authn.enable_pwned_password_api
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: When enabled, user password's vulnerability would be checked via pwned password database
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2021-09-22
# .. toggle_target_removal_date: 2021-12-31
# .. toggle_tickets: VAN-664
ENABLE_PWNED_PASSWORD_API = WaffleSwitch(
    f'{_WAFFLE_NAMESPACE}.enable_pwned_password_api', __name__)
Esempio n. 26
0
"""
Waffle flags and switches
"""

from edx_toggles.toggles import WaffleSwitch

WAFFLE_NAMESPACE = 'courseware'

# .. toggle_name: courseware.enable_new_financial_assistance_flow
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: enables new internal only financial assistance flow, when active.
# .. toggle_use_cases: opt_in
# .. toggle_creation_date: 2022-03-25
# .. toggle_tickets: https://openedx.atlassian.net/browse/PROD-2588
ENABLE_NEW_FINANCIAL_ASSISTANCE_FLOW = WaffleSwitch(
    f"{WAFFLE_NAMESPACE}.enable_new_financial_assistance_flow", __name__
)
Esempio n. 27
0
"""
Waffle flags and switches to change user API functionality.
"""

from django.utils.translation import ugettext_lazy as _

from edx_toggles.toggles import WaffleSwitch

SYSTEM_MAINTENANCE_MSG = _(
    u'System maintenance in progress. Please try again later.')

# .. toggle_name: user_api.enable_multiple_user_enterprises_feature
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: If enabled then learners linked to multiple enterprises will be asked to select default
#   enterprise for current session.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2019-11-01
# .. toggle_target_removal_date: 2021-06-01
# .. toggle_tickets: ENT-2339, ENT-4041
ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE = WaffleSwitch(
    'user_api.enable_multiple_user_enterprises_feature', __name__)
Esempio n. 28
0
"""
Waffle flags and switches for user authn.
"""

from edx_toggles.toggles import WaffleSwitch, WaffleSwitchNamespace

_WAFFLE_NAMESPACE = u'user_authn'
_WAFFLE_SWITCH_NAMESPACE = WaffleSwitchNamespace(name=_WAFFLE_NAMESPACE,
                                                 log_prefix=u'UserAuthN: ')

# .. toggle_name: user_authn.enable_login_using_thirdparty_auth_only
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: When enabled, users must be sign in using their allowed domain SSO account. This includes sign-
#   ins to the Django admin dashboard at "/admin".
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2019-11-20
# .. toggle_target_removal_date: 2020-01-31
# .. toggle_warnings: Requires THIRD_PARTY_AUTH_ONLY_DOMAIN to also be set.
# .. toggle_tickets: ENT-2461
ENABLE_LOGIN_USING_THIRDPARTY_AUTH_ONLY = WaffleSwitch(
    _WAFFLE_SWITCH_NAMESPACE, 'enable_login_using_thirdparty_auth_only',
    __name__)
Esempio n. 29
0
"""
Miscellaneous waffle switches that both LMS and Studio need to access
"""

from edx_toggles.toggles import WaffleSwitch

# Namespace
WAFFLE_NAMESPACE = 'course_experience'

# Switches
# .. toggle_name: course_experience.enable_about_sidebar_html
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: Used to determine whether to show custom HTML in the sidebar on the internal course about page.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2018-01-26
ENABLE_COURSE_ABOUT_SIDEBAR_HTML = WaffleSwitch(
    f'{WAFFLE_NAMESPACE}.enable_about_sidebar_html', __name__)
Esempio n. 30
0
"""
This module contains various configuration settings via
waffle switches for the contentstore app.
"""

from edx_toggles.toggles import WaffleFlag, WaffleSwitch

from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag

# Namespace
WAFFLE_NAMESPACE = 'studio'
LOG_PREFIX = 'Studio: '

# Switches
ENABLE_ACCESSIBILITY_POLICY_PAGE = WaffleSwitch(  # lint-amnesty, pylint: disable=toggle-missing-annotation
    f'{WAFFLE_NAMESPACE}.enable_policy_page', __name__)

# TODO: After removing this flag, add a migration to remove waffle flag in a follow-up deployment.
ENABLE_CHECKLISTS_QUALITY = CourseWaffleFlag(  # lint-amnesty, pylint: disable=toggle-missing-annotation
    f'{WAFFLE_NAMESPACE}.enable_checklists_quality', __name__, LOG_PREFIX)

SHOW_REVIEW_RULES_FLAG = CourseWaffleFlag(  # lint-amnesty, pylint: disable=toggle-missing-annotation
    f'{WAFFLE_NAMESPACE}.show_review_rules', __name__, LOG_PREFIX)

# Waffle flag to redirect to the library authoring MFE.
# .. toggle_name: contentstore.library_authoring_mfe
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Toggles the new micro-frontend-based implementation of the library authoring experience.
# .. toggle_use_cases: temporary, open_edx
# .. toggle_creation_date: 2020-08-03