ENT-4041 Multiple Enterprises Feature waffle switch annotation (#26321)
This commit is contained in:
@@ -17,10 +17,7 @@ from six.moves.urllib.parse import urlparse # pylint: disable=import-error
|
|||||||
from common.djangoapps.third_party_auth.config.waffle import ENABLE_MULTIPLE_SSO_ACCOUNTS_ASSOCIATION_TO_SAML_USER
|
from common.djangoapps.third_party_auth.config.waffle import ENABLE_MULTIPLE_SSO_ACCOUNTS_ASSOCIATION_TO_SAML_USER
|
||||||
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
|
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
|
||||||
from openedx.core.djangoapps.theming.helpers import get_config_value_from_site_or_settings, get_current_site
|
from openedx.core.djangoapps.theming.helpers import get_config_value_from_site_or_settings, get_current_site
|
||||||
from openedx.core.djangoapps.user_api.config.waffle import (
|
from openedx.core.djangoapps.user_api.config.waffle import ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE
|
||||||
ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE,
|
|
||||||
waffle as user_api_waffle
|
|
||||||
)
|
|
||||||
from xmodule.modulestore.django import modulestore
|
from xmodule.modulestore.django import modulestore
|
||||||
from xmodule.modulestore.exceptions import ItemNotFoundError
|
from xmodule.modulestore.exceptions import ItemNotFoundError
|
||||||
|
|
||||||
@@ -200,7 +197,7 @@ def is_multiple_user_enterprises_feature_enabled():
|
|||||||
Returns:
|
Returns:
|
||||||
Boolean value representing switch status
|
Boolean value representing switch status
|
||||||
"""
|
"""
|
||||||
return user_api_waffle().is_enabled(ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE)
|
return ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE.is_enabled()
|
||||||
|
|
||||||
|
|
||||||
def is_multiple_sso_accounts_association_to_saml_user_enabled():
|
def is_multiple_sso_accounts_association_to_saml_user_enabled():
|
||||||
|
|||||||
@@ -5,17 +5,19 @@ Waffle flags and switches to change user API functionality.
|
|||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from edx_toggles.toggles import LegacyWaffleSwitchNamespace
|
from edx_toggles.toggles import WaffleSwitch
|
||||||
|
|
||||||
SYSTEM_MAINTENANCE_MSG = _(u'System maintenance in progress. Please try again later.')
|
SYSTEM_MAINTENANCE_MSG = _(u'System maintenance in progress. Please try again later.')
|
||||||
WAFFLE_NAMESPACE = u'user_api'
|
|
||||||
|
|
||||||
# Switches
|
# .. toggle_name: user_api.enable_multiple_user_enterprises_feature
|
||||||
ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE = u'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
|
||||||
def waffle():
|
# enterprise for current session.
|
||||||
"""
|
# .. toggle_use_cases: temporary
|
||||||
Returns the namespaced, cached, audited Waffle class for user_api.
|
# .. toggle_creation_date: 2019-11-01
|
||||||
"""
|
# .. toggle_target_removal_date: 2021-06-01
|
||||||
return LegacyWaffleSwitchNamespace(name=WAFFLE_NAMESPACE, log_prefix=u'UserAPI: ')
|
# .. toggle_tickets: ENT-2339, ENT-4041
|
||||||
|
ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE = WaffleSwitch(
|
||||||
|
'user_api.enable_multiple_user_enterprises_feature', __name__
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user