Start waffle namespace deprecation

By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
This commit is contained in:
Régis Behmo
2020-11-05 09:10:37 +01:00
parent 4344da80a1
commit a16cd71046
45 changed files with 150 additions and 144 deletions

View File

@@ -3,10 +3,10 @@ Waffle flags and switches for user authn.
"""
from edx_toggles.toggles import WaffleSwitch, WaffleSwitchNamespace
from edx_toggles.toggles import LegacyWaffleSwitch, LegacyWaffleSwitchNamespace
_WAFFLE_NAMESPACE = u'user_authn'
_WAFFLE_SWITCH_NAMESPACE = WaffleSwitchNamespace(name=_WAFFLE_NAMESPACE, log_prefix=u'UserAuthN: ')
_WAFFLE_SWITCH_NAMESPACE = LegacyWaffleSwitchNamespace(name=_WAFFLE_NAMESPACE, log_prefix=u'UserAuthN: ')
# .. toggle_name: user_authn.enable_login_using_thirdparty_auth_only
# .. toggle_implementation: WaffleSwitch
@@ -18,7 +18,7 @@ _WAFFLE_SWITCH_NAMESPACE = WaffleSwitchNamespace(name=_WAFFLE_NAMESPACE, log_pre
# .. 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(
ENABLE_LOGIN_USING_THIRDPARTY_AUTH_ONLY = LegacyWaffleSwitch(
_WAFFLE_SWITCH_NAMESPACE,
'enable_login_using_thirdparty_auth_only',
__name__

View File

@@ -21,7 +21,7 @@ from django.utils.translation import get_language
from django.utils.translation import ugettext as _
from django.views.decorators.csrf import csrf_exempt, ensure_csrf_cookie
from django.views.decorators.debug import sensitive_post_parameters
from edx_toggles.toggles import WaffleFlag, WaffleFlagNamespace
from edx_toggles.toggles import LegacyWaffleFlag, LegacyWaffleFlagNamespace
from pytz import UTC
from ratelimit.decorators import ratelimit
from requests import HTTPError
@@ -104,8 +104,8 @@ REGISTER_USER = Signal(providing_args=["user", "registration"])
# .. toggle_target_removal_date: 2020-06-01
# .. toggle_warnings: This temporary feature toggle does not have a target removal date.
# .. toggle_tickets: None
REGISTRATION_FAILURE_LOGGING_FLAG = WaffleFlag(
waffle_namespace=WaffleFlagNamespace(name=u'registration'),
REGISTRATION_FAILURE_LOGGING_FLAG = LegacyWaffleFlag(
waffle_namespace=LegacyWaffleFlagNamespace(name=u'registration'),
flag_name=u'enable_failure_logging',
module_name=__name__,
)