Merge pull request #18296 from edx/colelrogers/remove-GDPR-flag
Removed GDPR flags and usages WIP
This commit is contained in:
@@ -188,8 +188,7 @@ class CombinedLoginAndRegisterPage(PageObject):
|
||||
).fulfill()
|
||||
|
||||
def register(
|
||||
self, email="", password="", username="", full_name="", country="", favorite_movie="",
|
||||
terms_of_service=False
|
||||
self, email="", password="", username="", full_name="", country="", favorite_movie=""
|
||||
):
|
||||
"""Fills in and submits the registration form.
|
||||
|
||||
@@ -204,11 +203,10 @@ class CombinedLoginAndRegisterPage(PageObject):
|
||||
username (unicode): The user's username.
|
||||
full_name (unicode): The user's full name.
|
||||
country (unicode): Two-character country code.
|
||||
terms_of_service (boolean): If True, agree to the terms of service and honor code.
|
||||
|
||||
"""
|
||||
# Fill in the form
|
||||
self.wait_for_element_visibility('#register-honor_code', 'Honor code field is shown')
|
||||
self.wait_for_element_visibility('#toggle_optional_fields', 'Support education research field is shown')
|
||||
if email:
|
||||
self.q(css="#register-email").fill(email)
|
||||
if full_name:
|
||||
@@ -221,10 +219,6 @@ class CombinedLoginAndRegisterPage(PageObject):
|
||||
self.q(css="#register-country").results[0].send_keys(country)
|
||||
if favorite_movie:
|
||||
self.q(css="#register-favorite_movie").fill(favorite_movie)
|
||||
if terms_of_service:
|
||||
self.q(css="label[for='register-honor_code']").click()
|
||||
self.q(css="#register-honor_code").click()
|
||||
EmptyPromise(lambda: self.q(css='#register-honor_code:checked'), 'Honor code field is checked').fulfill()
|
||||
|
||||
# Submit it
|
||||
self.q(css=".register-button").click()
|
||||
|
||||
@@ -310,8 +310,7 @@ class RegisterFromCombinedPageTest(UniqueCourseTest):
|
||||
username=username,
|
||||
full_name="Test User",
|
||||
country="US",
|
||||
favorite_movie="Mad Max: Fury Road",
|
||||
terms_of_service=True
|
||||
favorite_movie="Mad Max: Fury Road"
|
||||
)
|
||||
|
||||
# Expect that we reach the dashboard and we're auto-enrolled in the course
|
||||
@@ -332,14 +331,11 @@ class RegisterFromCombinedPageTest(UniqueCourseTest):
|
||||
email=email,
|
||||
password="password",
|
||||
username="",
|
||||
full_name="Test User",
|
||||
terms_of_service=False
|
||||
full_name="Test User"
|
||||
)
|
||||
# Verify that the expected errors are displayed.
|
||||
errors = self.register_page.wait_for_errors()
|
||||
self.assertIn(u'Please enter your Public Username.', errors)
|
||||
self.assertIn(u'You must agree to the édX Terms of Service and Honor Code',
|
||||
errors)
|
||||
self.assertIn(u'Select your country or region of residence.', errors)
|
||||
self.assertIn(u'Please tell us your favorite movie.', errors)
|
||||
|
||||
@@ -372,8 +368,8 @@ class RegisterFromCombinedPageTest(UniqueCourseTest):
|
||||
self.assertEqual(self.register_page.full_name_value, "William Adama")
|
||||
self.assertIn("Galactica1", self.register_page.username_value)
|
||||
|
||||
# Set country, accept the terms, and submit the form:
|
||||
self.register_page.register(country="US", favorite_movie="Battlestar Galactica", terms_of_service=True)
|
||||
# Set country and submit the form:
|
||||
self.register_page.register(country="US", favorite_movie="Battlestar Galactica")
|
||||
|
||||
# Expect that we reach the dashboard and we're auto-enrolled in the course
|
||||
course_names = self.dashboard_page.wait_for_page().available_courses
|
||||
|
||||
@@ -162,7 +162,6 @@ class AutoEnrollmentWithCSVTest(BaseInstructorDashboardTest):
|
||||
password="123456",
|
||||
username=username,
|
||||
full_name="Test User",
|
||||
terms_of_service=True,
|
||||
country="US",
|
||||
favorite_movie="Harry Potter",
|
||||
)
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
enterpriseReadonlyAccountFields,
|
||||
edxSupportUrl,
|
||||
extendedProfileFields,
|
||||
displayAccountDeletion,
|
||||
enableGDPRFlag
|
||||
displayAccountDeletion
|
||||
) {
|
||||
var $accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData,
|
||||
accountsSectionData, ordersSectionData, accountSettingsView, showAccountSettingsPage,
|
||||
@@ -303,8 +302,8 @@
|
||||
aboutSectionsData.push(accountDeletionFields);
|
||||
}
|
||||
|
||||
|
||||
// set TimeZoneField to listen to CountryField
|
||||
|
||||
getUserField = function(list, search) {
|
||||
return _.find(list, function(field) {
|
||||
return field.view.options.valueAttribute === search;
|
||||
|
||||
@@ -15,8 +15,6 @@ from openedx.core.djangolib.markup import HTML, Text
|
||||
from branding import api as branding_api
|
||||
from openedx.core.djangoapps.lang_pref.api import header_language_selector_is_enabled, released_languages
|
||||
|
||||
# GDPR Flag
|
||||
from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG
|
||||
%>
|
||||
|
||||
## Provide a hook for themes to inject branding on top.
|
||||
@@ -32,7 +30,7 @@ from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG
|
||||
% endif
|
||||
|
||||
<header class="global-header ${'slim' if course else ''}">
|
||||
% if use_cookie_banner and ENABLE_GDPR_COMPAT_FLAG.is_enabled_without_course_context():
|
||||
% if use_cookie_banner:
|
||||
${static.renderReact(
|
||||
component="CookiePolicyBanner",
|
||||
id="cookie-policy-banner",
|
||||
|
||||
@@ -10,9 +10,6 @@ from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
|
||||
from openedx.core.djangolib.markup import HTML
|
||||
from webpack_loader.templatetags.webpack_loader import render_bundle
|
||||
|
||||
# GDPR Flag
|
||||
from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG
|
||||
%>
|
||||
|
||||
<%inherit file="/main.html" />
|
||||
@@ -49,7 +46,6 @@ from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG
|
||||
edxSupportUrl = '${ edx_support_url | n, js_escaped_string }',
|
||||
extendedProfileFields = ${ extended_profile_fields | n, dump_js_escaped_json },
|
||||
displayAccountDeletion = ${ enable_account_deletion | n, dump_js_escaped_json};
|
||||
enableGDPRFlag = ${ ENABLE_GDPR_COMPAT_FLAG.is_enabled_without_course_context() | n, dump_js_escaped_json };
|
||||
|
||||
AccountSettingsFactory(
|
||||
fieldsData,
|
||||
@@ -69,16 +65,14 @@ from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG
|
||||
enterpriseReadonlyAccountFields,
|
||||
edxSupportUrl,
|
||||
extendedProfileFields,
|
||||
displayAccountDeletion,
|
||||
enableGDPRFlag
|
||||
displayAccountDeletion
|
||||
);
|
||||
</%static:require_module>
|
||||
% if ENABLE_GDPR_COMPAT_FLAG.is_enabled_without_course_context():
|
||||
<script type="text/javascript">
|
||||
window.auth = ${ auth | n, dump_js_escaped_json };
|
||||
window.isActive = ${ user.is_active | n, dump_js_escaped_json };
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.auth = ${ auth | n, dump_js_escaped_json };
|
||||
window.isActive = ${ user.is_active | n, dump_js_escaped_json };
|
||||
</script>
|
||||
<%static:webpack entry="StudentAccountDeletionInitializer">
|
||||
</%static:webpack>
|
||||
% endif
|
||||
</%block>
|
||||
|
||||
@@ -14,7 +14,6 @@ from openedx.core.djangolib.markup import HTML, Text
|
||||
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
|
||||
from openedx.core.djangoapps.user_api.helpers import FormDescription
|
||||
from openedx.core.lib.mobile_utils import is_request_from_mobile_app
|
||||
from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG
|
||||
from openedx.features.enterprise_support.api import enterprise_customer_for_request
|
||||
from student.forms import get_registration_extension_form
|
||||
from student.models import UserProfile
|
||||
@@ -832,11 +831,10 @@ class RegistrationFormFactory(object):
|
||||
)
|
||||
field_type = 'checkbox'
|
||||
|
||||
if ENABLE_GDPR_COMPAT_FLAG.is_enabled_without_course_context() and not separate_honor_and_tos:
|
||||
if not separate_honor_and_tos:
|
||||
current_request = crum.get_current_request()
|
||||
|
||||
if not is_request_from_mobile_app(current_request):
|
||||
field_type = 'plaintext'
|
||||
field_type = 'plaintext'
|
||||
|
||||
pp_link = marketing_link("PRIVACY")
|
||||
label = Text(_(
|
||||
|
||||
@@ -1651,17 +1651,24 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
|
||||
@mock.patch.dict(settings.FEATURES, {"ENABLE_MKTG_SITE": True})
|
||||
def test_registration_honor_code_mktg_site_enabled(self):
|
||||
link_template = "<a href='https://www.test.com/honor' target='_blank'>{link_label}</a>"
|
||||
link_template2 = "<a href='#' target='_blank'>{link_label}</a>"
|
||||
link_label = "Terms of Service and Honor Code"
|
||||
link_label2 = "Privacy Policy"
|
||||
self._assert_reg_field(
|
||||
{"honor_code": "required"},
|
||||
{
|
||||
"label": u"I agree to the {platform_name} {link_label}".format(
|
||||
"label": (u"By creating an account with {platform_name}, you agree {spacing}"
|
||||
u"to abide by our {platform_name} {spacing}"
|
||||
u"{link_label} {spacing}"
|
||||
u"and agree to our {link_label2}.").format(
|
||||
platform_name=settings.PLATFORM_NAME,
|
||||
link_label=link_template.format(link_label=link_label)
|
||||
link_label=link_template.format(link_label=link_label),
|
||||
link_label2=link_template2.format(link_label=link_label2),
|
||||
spacing=' ' * 18
|
||||
),
|
||||
"name": "honor_code",
|
||||
"defaultValue": False,
|
||||
"type": "checkbox",
|
||||
"type": "plaintext",
|
||||
"required": True,
|
||||
"errorMessages": {
|
||||
"required": u"You must agree to the {platform_name} {link_label}".format(
|
||||
@@ -1675,17 +1682,24 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
|
||||
@override_settings(MKTG_URLS_LINK_MAP={"HONOR": "honor"})
|
||||
@mock.patch.dict(settings.FEATURES, {"ENABLE_MKTG_SITE": False})
|
||||
def test_registration_honor_code_mktg_site_disabled(self):
|
||||
link_template = "<a href='/privacy' target='_blank'>{link_label}</a>"
|
||||
link_label = "Terms of Service and Honor Code"
|
||||
link_label2 = "Privacy Policy"
|
||||
self._assert_reg_field(
|
||||
{"honor_code": "required"},
|
||||
{
|
||||
"label": u"I agree to the {platform_name} {link_label}".format(
|
||||
"label": (u"By creating an account with {platform_name}, you agree {spacing}"
|
||||
u"to abide by our {platform_name} {spacing}"
|
||||
u"{link_label} {spacing}"
|
||||
u"and agree to our {link_label2}.").format(
|
||||
platform_name=settings.PLATFORM_NAME,
|
||||
link_label=self.link_template.format(link_label=link_label)
|
||||
link_label=self.link_template.format(link_label=link_label),
|
||||
link_label2=link_template.format(link_label=link_label2),
|
||||
spacing=' ' * 18
|
||||
),
|
||||
"name": "honor_code",
|
||||
"defaultValue": False,
|
||||
"type": "checkbox",
|
||||
"type": "plaintext",
|
||||
"required": True,
|
||||
"errorMessages": {
|
||||
"required": u"You must agree to the {platform_name} {link_label}".format(
|
||||
|
||||
@@ -43,10 +43,6 @@ LATEST_UPDATE_FLAG = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'latest_update')
|
||||
# Waffle flag to enable the use of Bootstrap for course experience pages
|
||||
USE_BOOTSTRAP_FLAG = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'use_bootstrap', flag_undefined_default=True)
|
||||
|
||||
#Waffle flag to control whether or not the the site shows GDPR updates.
|
||||
# TODO: Delete as part of LEARNER-4422
|
||||
ENABLE_GDPR_COMPAT_FLAG = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'gdpr')
|
||||
|
||||
|
||||
def course_home_page_title(course): # pylint: disable=unused-argument
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user