Removes enterprise filter for account recovery banner

Previously code was only showing banner for enterprise
learners. This patch would remove this restriction
and is available to all edX learners provided that
'enable_secondary_email_feature' is switched on.

PROD-1477
This commit is contained in:
Adeel Khan
2020-04-29 15:56:13 +05:00
parent 70600d79d7
commit 9778e69c76
4 changed files with 6 additions and 18 deletions

View File

@@ -16,7 +16,7 @@ from six import text_type
from lms.djangoapps.badges.utils import badges_enabled
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api import errors
from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_feature_enabled_for_user
from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_feature_enabled
from openedx.core.djangoapps.user_api.models import RetirementState, UserPreference, UserRetirementStatus
from openedx.core.djangoapps.user_api.serializers import ReadOnlyFieldsSerializerMixin
from student.models import LanguageProficiency, SocialLink, UserProfile
@@ -172,7 +172,7 @@ class UserReadOnlySerializer(serializers.Serializer):
}
)
if is_secondary_email_feature_enabled_for_user(user):
if is_secondary_email_feature_enabled():
data.update(
{
"secondary_email": account_recovery.secondary_email if account_recovery else None,

View File

@@ -192,18 +192,6 @@ def is_secondary_email_feature_enabled():
return waffle.switch_is_active(ENABLE_SECONDARY_EMAIL_FEATURE_SWITCH)
def is_secondary_email_feature_enabled_for_user(user):
"""
Checks to see if secondary email feature is enabled for the given user.
Returns:
Boolean value representing the status of secondary email feature.
"""
# import is placed here to avoid cyclic import.
from openedx.features.enterprise_support.utils import is_enterprise_learner
return is_secondary_email_feature_enabled() and is_enterprise_learner(user)
def is_multiple_user_enterprises_feature_enabled():
"""
Checks to see if the django-waffle switch for enabling the multiple user enterprises feature is active